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

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

Issue 694423002: Replace <link rel="import"> with <import> (Closed) Base URL: git@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
1 <html> 1 <html>
2 <link rel="import" href="../resources/dump-as-text.sky" /> 2 <import src="../resources/dump-as-text.sky" />
3 <link rel="import" href="../resources/chai.sky" /> 3 <import src="../resources/chai.sky" />
4 <body> 4 <body>
5 This test ensures that is visible in following script block. 5 This test ensures that is visible in following script block.
6 <script> 6 <script>
7 window.callbacksCalled = []; 7 window.callbacksCalled = [];
8 8
9 function fooCreatedFunction() { 9 function fooCreatedFunction() {
10 assert.deepEqual(window.callbacksCalled, []); 10 assert.deepEqual(window.callbacksCalled, []);
11 window.callbacksCalled.push(this.tagName); 11 window.callbacksCalled.push(this.tagName);
12 this.appendChild(document.createElement("x-bar")); 12 this.appendChild(document.createElement("x-bar"));
13 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']); 13 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']);
14 } 14 }
15 15
16 function barCreatedFunction() { 16 function barCreatedFunction() {
17 assert.deepEqual(window.callbacksCalled, ['x-foo']); 17 assert.deepEqual(window.callbacksCalled, ['x-foo']);
18 window.callbacksCalled.push(this.tagName); 18 window.callbacksCalled.push(this.tagName);
19 } 19 }
20 20
21 document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototy pe, { createdCallback: { value: fooCreatedFunction } }) }); 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 } }) }); 22 document.registerElement("x-bar", { prototype: Object.create(HTMLElement.prototy pe, { createdCallback: { value: barCreatedFunction } }) });
23 </script> 23 </script>
24 <script> 24 <script>
25 document.createElement("x-foo"); 25 document.createElement("x-foo");
26 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']); 26 assert.deepEqual(window.callbacksCalled, ['x-foo', 'x-bar']);
27 </script> 27 </script>
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698