Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: sky/tests/custom-elements/lifecycle-created-createElement-reentrancy.html

Issue 685623002: Move the tests from .html to .sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <link rel="import" href="../resources/dump-as-text.html" />
3 <link rel="import" href="../resources/chai.html" />
4 <body>
5 This test ensures that is visible in following script block.
6 <script>
7 window.callbacksCalled = [];
8
9 function fooCreatedFunction() {
10 assert.deepEqual(window.callbacksCalled, []);
11 window.callbacksCalled.push(this.tagName);
12 this.appendChild(document.createElement("x-bar"));
13 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']);
14 }
15
16 function barCreatedFunction() {
17 assert.deepEqual(window.callbacksCalled, ['x-foo']);
18 window.callbacksCalled.push(this.tagName);
19 }
20
21 document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototy pe, { createdCallback: { value: fooCreatedFunction } }) });
22 document.registerElement("x-bar", { prototype: Object.create(HTMLElement.prototy pe, { createdCallback: { value: barCreatedFunction } }) });
23 </script>
24 <script>
25 document.createElement("x-foo");
26 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']);
27 </script>
28 </body>
29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698