Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Mar 1, 2016
1 parent cc0e9df commit 02660c1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/runner.html
Expand Up @@ -69,6 +69,7 @@
'unit/dom-if.html',
'unit/dom-template.html',
'unit/dom-bind.html',
'unit/dom-bind-yield.html',
'unit/script-after-import-in-head.html',
'unit/globals.html'
];
Expand Down
64 changes: 64 additions & 0 deletions test/unit/dom-bind-yield.html
@@ -0,0 +1,64 @@
<!doctype html>
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<script src="../../../web-component-tester/browser.js"></script>
</head>
<body>

<link rel="import" href="../../polymer.html">

<script>
if (window.Polymer) {
Polymer({
is: 'x-fire',
ready: function() {
this.fire('fired');
}
})
}
</script>

<template is="dom-bind" id="domBind">
<x-fire on-fired="fired"></x-fire>
</template>

<script>
if (window.Polymer) {
var now = Date.now() + 1000;
while (Date.now() < now) {}
}
</script>

<script>
domBind.fired = function() {
this.didFire = true;
}
</script>

<script>

if (window.Polymer) {

suite('bind stamps after page fully loads (despite yielding)', function() {

test('event handled', function() {
assert.isTrue(domBind.didFire);
});

});

}

</script>
</body>
</html>

0 comments on commit 02660c1

Please sign in to comment.