blob: 7bfdca4817b2aa9790a40679af3e812091e4a770 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharness-helpers.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../fast/dom/custom/testutils.js"></script>
<body>
<script>
'use strict';
// TODO(dominicc): Port fork() etc. to work with testharness, then
// remove these.
function debug() {}
function finishJSTest() {}
(() => {
if (fork()) {
// The controlling parent frame.
let t = async_test('context is destroyed; call across context');
let watcher = new EventWatcher(t, window, 'message');
watcher.wait_for('message').then(t.step_func((event) => {
assert_equals(event.data, 'PASS destroyed context');
return watcher.wait_for('message');
})).then(t.step_func((event) => {
assert_equals(event.data, 'PASS child done');
let e = new window.C();
assert_true(e instanceof C, 'should have created an element');
t.done();
}));
} else {
// The child frame.
class C extends HTMLElement {}
window.customElements.define('a-a', C);
window.parent.C = C;
destroyContext();
done();
}
})();
</script>