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('context is destroyed; call across context'); |
| 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 let e = new window.C(); |
| 27 assert_true(e instanceof C, 'should have created an element'); |
| 28 t.done(); |
| 29 })); |
| 30 } else { |
| 31 // The child frame. |
| 32 class C extends HTMLElement {} |
| 33 window.customElements.define('a-a', C); |
| 34 window.parent.C = C; |
| 35 destroyContext(); |
| 36 done(); |
| 37 } |
| 38 |
| 39 })(); |
| 40 </script> |
OLD | NEW |