Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 'use strict' | |
| 6 setup({ explicit_done: true }); | |
| 7 let reactions = []; | |
| 8 customElements.define('x-x', class extends HTMLElement { | |
| 9 constructor() { | |
| 10 super(); | |
| 11 reactions.push({ type: 'constructor', element: this }); | |
| 12 console.log("constructor", this); | |
| 13 } | |
| 14 }); | |
| 15 test(() => { | |
| 16 assert_equals(reactions.length, 0); | |
| 17 }, 'Should not have parsed <x-x> yet'); | |
| 18 </script> | |
| 19 | |
| 20 <x-x></x-x> | |
| 21 | |
| 22 <script> | |
| 23 test(() => { | |
| 24 assert_equals(reactions.length, 1); | |
| 25 }, 'Parser should create custom if after define'); | |
| 26 | |
| 27 let import1 = document.createElement('link'); | |
| 28 import1.rel = 'import'; | |
| 29 import1.href = 'resources/import-custom.html'; | |
| 30 document.head.appendChild(import1); | |
| 31 | |
| 32 import1.onload = () => { | |
| 33 test(() => { | |
| 34 assert_equals(reactions.length, 2); | |
|
dominicc (has gone to gerrit)
2016/07/13 06:12:30
These presumably have to be in order. Can you push
kojii
2016/07/13 06:47:16
The test does push the actual object. Also the oth
kojii
2016/07/13 07:00:13
Done in PS5.
| |
| 35 }, 'import should create custom if after define'); | |
|
dominicc (has gone to gerrit)
2016/07/13 06:12:30
These descriptions are cryptic; what is create cus
| |
| 36 | |
| 37 done(); | |
| 38 }; | |
| 39 </script> | |
| OLD | NEW |