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 src="../../../http/tests/htmlimports/resources/import-custom-element-hel per.js"></script> | |
7 </head> | |
8 <body> | |
9 <script> | |
10 var Hello = registerTestingCustomElement('x-hello'); | |
11 | |
12 var numberOfLinks = 6; | |
13 var t1 = async_test('Instantiate custom elements in async imports.'); | |
14 var t2 = async_test('Resolve custom elements in async imports later.'); | |
15 var latch = new ImportTestLatch(function() { | |
16 // FIXME(crbug.com/366877): Need another cycle to ensure microtasks are perf ormed. | |
17 setTimeout(function() { | |
18 t1.step(function() { | |
19 assert_array_equals(['hello-3', 'hello-4', 'hello-5', 'hello-6', 'he llo-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p56-2'], Hello.ids.slice(0).sor t(), 'All elements are upgraded only once'); | |
20 // Remove async links whose loading orders are't deterministic. | |
dominicc (has gone to gerrit)
2014/04/28 01:32:32
aren't
Hajime Morrita
2014/04/29 23:11:37
Done.
| |
21 Hello.ids.splice(Hello.ids.indexOf('hello-4'), 1); | |
22 Hello.ids.splice(Hello.ids.indexOf('hello-6'), 1); | |
23 assert_array_equals(['hello-p34-1', 'hello-3', 'hello-p34-2', 'hello -5', 'hello-p56-1', 'hello-p56-2'], Hello.ids, 'Elements from non async improts are upgraded in order'); | |
24 t1.done(); | |
25 }); | |
26 | |
27 t2.step(function() { | |
28 var Bye = registerTestingCustomElement('x-bye'); | |
29 assert_array_equals(['bye-3', 'bye-4', 'bye-5', 'bye-6', 'bye-p34-1' , 'bye-p34-2', 'bye-p56-1', 'bye-p56-2'], Bye.ids.slice(0).sort(), 'All elements are upgraded only once'); | |
30 // Remove async links whose loading orders are't deterministic. | |
31 Bye.ids.splice(Bye.ids.indexOf('bye-4'), 1); | |
32 Bye.ids.splice(Bye.ids.indexOf('bye-6'), 1); | |
33 assert_array_equals(['bye-p34-1', 'bye-3', 'bye-p34-2', 'bye-5', 'by e-p56-1', 'bye-p56-2'], Bye.ids, 'Elements from non async improts are upgraded i n order'); | |
34 t2.done(); | |
35 }); | |
36 }, 0); | |
37 }, numberOfLinks); | |
38 </script> | |
39 <link rel="import" href="resources/custom-element-hello-parent-34.html" onload=" latch.loaded()"> | |
40 <link rel="import" href="resources/custom-element-hello-3.html" onload="latch.lo aded()"> | |
41 <link rel="import" href="resources/custom-element-hello-4.html" async onload="la tch.loaded()"> | |
42 <link rel="import" href="resources/custom-element-hello-5.html" onload="latch.lo aded()"> | |
43 <link rel="import" href="resources/custom-element-hello-6.html" async onload="la tch.loaded()"> | |
44 <link rel="import" href="resources/custom-element-hello-parent-56.html" onload=" latch.loaded()"> | |
45 </body> | |
46 </html> | |
OLD | NEW |