| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script> | 4 <script> |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 let reactions = []; | 7 let reactions = []; |
| 8 | 8 |
| 9 let test = async_test('Constructor should run in the order elements are created'
); | 9 let test = async_test('Constructor should run in the order elements are created'
); |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 test.step(() => { | 27 test.step(() => { |
| 28 assert_equals(reactions.length, 1, 'Parser should invoke the custom element co
nstructor'); | 28 assert_equals(reactions.length, 1, 'Parser should invoke the custom element co
nstructor'); |
| 29 }); | 29 }); |
| 30 | 30 |
| 31 let import1 = document.createElement('link'); | 31 let import1 = document.createElement('link'); |
| 32 import1.rel = 'import'; | 32 import1.rel = 'import'; |
| 33 import1.href = 'resources/import-custom.html'; | 33 import1.href = 'resources/import-custom.html'; |
| 34 | 34 |
| 35 // TODO(kochi): crbug.com/640465 synchronous creation fails in imports. | 35 // TODO(kochi): crbug.com/640465 synchronous creation fails in imports. |
| 36 import1.onload = test.step_func_done(() => { | 36 import1.onload = test.step_func_done(() => { |
| 37 let elementsInMaster = document.querySelector('x-x'); | 37 let elementInMaster = document.querySelector('x-x'); |
| 38 let elementsInImport = import1.import.querySelector('x-x'); | 38 let elementInImport = import1.import.querySelector('x-x'); |
| 39 | 39 |
| 40 assert_array_equals(reactions, [elementsInMaster, elementsInImport], | 40 assert_array_equals(reactions, [elementInMaster, elementInImport], |
| 41 'Constructor should run in the order elements are created'
); | 41 'Constructor should run in the order elements are created'
); |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 document.head.appendChild(import1); | 44 document.head.appendChild(import1); |
| 45 </script> | 45 </script> |
| OLD | NEW |