OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharness-helpers.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="../fast/dom/custom/testutils.js"></script> |
| 6 <body> |
| 7 <script> |
| 8 'use strict'; |
| 9 |
| 10 // TODO(dominicc): Port fork() etc. to work with testharness, then |
| 11 // remove these. |
| 12 function debug() {} |
| 13 function finishJSTest() {} |
| 14 |
| 15 (() => { |
| 16 |
| 17 if (fork()) { |
| 18 // The controlling parent frame. |
| 19 let t = async_test('constructor destroys the context before super'); |
| 20 let watcher = new EventWatcher(t, window, 'message'); |
| 21 watcher.wait_for('message').then(t.step_func((event) => { |
| 22 assert_equals(event.data, 'PASS destroyed context'); |
| 23 return watcher.wait_for('message'); |
| 24 })).then(t.step_func((event) => { |
| 25 assert_equals(event.data, 'PASS child done'); |
| 26 t.done(); |
| 27 })); |
| 28 } else { |
| 29 // The child frame. |
| 30 class BadConstructor extends HTMLElement { |
| 31 constructor() { |
| 32 destroyContext(); |
| 33 super(); |
| 34 } |
| 35 } |
| 36 window.customElements.define('x-x', BadConstructor); |
| 37 try { |
| 38 new BadConstructor(); |
| 39 } finally { |
| 40 done(); |
| 41 } |
| 42 } |
| 43 |
| 44 })(); |
| 45 </script> |
OLD | NEW |