Chromium Code Reviews| 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="resources/import-custom-element-helper.js"></script> | |
| 7 </head> | |
| 8 <body> | |
| 9 <script> | |
| 10 var hello = registerTestingCustomElement('x-hello'); | |
| 11 | |
| 12 var t1 = async_test('Instantiate custom elements in async imports.'); | |
| 13 var t2 = async_test('Resolve custom elements in async imports later.'); | |
| 14 var latch = new ImportTestLatch(function() { | |
| 15 // FIXME(crbug.com/366877): Need another cycle to ensure microtasks are perf ormed. | |
| 16 setTimeout(function() { | |
| 17 t1.step(function() { | |
| 18 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"); | |
| 19 hello.ids.splice(hello.ids.indexOf('hello-4'), 1); | |
|
dominicc (has gone to gerrit)
2014/04/25 02:39:45
I think this needs a comment, maybe some whitespac
| |
| 20 hello.ids.splice(hello.ids.indexOf('hello-6'), 1); | |
| 21 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"); | |
| 22 t1.done(); | |
| 23 }); | |
| 24 | |
| 25 t2.step(function() { | |
| 26 var bye = registerTestingCustomElement('x-bye'); | |
| 27 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"); | |
|
dominicc (has gone to gerrit)
2014/04/25 02:39:45
Again, ' vs "
| |
| 28 bye.ids.splice(bye.ids.indexOf('bye-4'), 1); | |
| 29 bye.ids.splice(bye.ids.indexOf('bye-6'), 1); | |
| 30 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"); | |
| 31 t2.done(); | |
| 32 }); | |
| 33 }, 0); | |
| 34 }, 6); | |
| 35 </script> | |
| 36 <link rel="import" href="resources/custom-element-hello-parent-34.html" onload=" latch.loaded()"> | |
| 37 <link rel="import" href="resources/custom-element-hello-3.html" onload="latch.lo aded()"> | |
| 38 <link rel="import" href="resources/custom-element-hello-4.html" async onload="la tch.loaded()"> | |
| 39 <link rel="import" href="resources/custom-element-hello-5.html" onload="latch.lo aded()"> | |
| 40 <link rel="import" href="resources/custom-element-hello-6.html" async onload="la tch.loaded()"> | |
| 41 <link rel="import" href="resources/custom-element-hello-parent-56.html" onload=" latch.loaded()"> | |
| 42 </body> | |
| 43 </html> | |
| OLD | NEW |