4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 <script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script>
10 var Hello = registerTestingCustomElement('x-hello');
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() {
17 assert_array_equals(['hello-3', 'hello-4', 'hello-5', 'hello-6', 'hello-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p56-2'], Hello.ids.slice(0).sort(), 'All elements are upgraded only once');
18 // Remove async links whose loading orders aren't deterministic.
19 Hello.ids.splice(Hello.ids.indexOf('hello-4'), 1);
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');
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');
28 // Remove async links whose loading orders are't deterministic.
29 Bye.ids.splice(Bye.ids.indexOf('bye-4'), 1);
30 Bye.ids.splice(Bye.ids.indexOf('bye-6'), 1);
31 assert_array_equals(['bye-p34-1', 'bye-3', 'bye-p34-2', 'bye-5', 'bye-p56-1', 'bye-p56-2'], Bye.ids, 'Elements from non async improts are upgraded in order');
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.loaded()">
38 <link rel="import" href="resources/custom-element-hello-4.html" async onload="latch.loaded()">
39 <link rel="import" href="resources/custom-element-hello-5.html" onload="latch.loaded()">
40 <link rel="import" href="resources/custom-element-hello-6.html" async onload="latch.loaded()">
41 <link rel="import" href="resources/custom-element-hello-parent-56.html" onload="latch.loaded()">