OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/testharness.js"></script> | |
5 <script src="../../../resources/testharnessreport.js"></script> | |
6 <script> | |
7 | |
8 function registerTestingCustomElement(tagName) { | |
dominicc (has gone to gerrit)
2014/04/25 02:39:45
This looks similar to the one in import-custom-ele
| |
9 var definition = function() {}; | |
10 definition.ids = []; | |
11 definition.prototype = Object.create(HTMLElement.prototype); | |
12 definition.prototype.createdCallback = function() { definition.ids.push(this .id); } | |
13 document.registerElement(tagName, definition); | |
14 return definition; | |
15 } | |
16 | |
17 var hello = registerTestingCustomElement('x-hello'); | |
18 var t1 = async_test('Custom element in async imports wait preceeding sync import before upgraded.'); | |
19 var t2 = async_test('Custom element in async imports wait preceeding sync import before resolved.'); | |
20 | |
21 function ready() | |
22 { | |
dominicc (has gone to gerrit)
2014/04/25 02:39:45
No newline
| |
23 t1.step(function() { | |
24 assert_array_equals(['hello-slow', 'hello-2', 'hello-1'], hello.ids); | |
25 t1.done(); | |
26 }); | |
27 | |
28 t2.step(function() { | |
29 var bye = registerTestingCustomElement('x-bye'); | |
30 assert_array_equals(['bye-slow', 'bye-2', 'bye-1'], bye.ids); | |
31 t2.done(); | |
32 }); | |
33 } | |
34 </script> | |
35 </head> | |
36 <body> | |
37 <link rel=import href="resources/import-slow-custom-element-hello.cgi"> | |
38 <link rel=import async href="resources/import-custom-element-hello-1.html" onloa d="ready()"> | |
39 <x-hello id="hello-2"></x-hello> | |
40 <x-bye id="bye-2"></x-bye> | |
41 </body> | |
42 </html> | |
OLD | NEW |