Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /navigation-api/navigate-event/signal-abort-detach-in-onnavigate.html - WPT Dashboard Interop Dashboard
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="i" src="/common/blank.html"></iframe>
<script>
promise_test(async t => {
await new Promise(resolve => i.onload = resolve);
let iframe_constructor = i.contentWindow.DOMException;
let iframe_typeerror = i.contentWindow.TypeError;
let abort_signal;
let onabort_called = false;
i.contentWindow.navigation.onnavigate = t.step_func(e => {
abort_signal = e.signal;
abort_signal.onabort = () => onabort_called = true;
i.remove();
});
await promise_rejects_dom(t, 'AbortError', iframe_constructor, i.contentWindow.navigation.navigate("#1").committed);
assert_true(abort_signal.aborted);
assert_true(onabort_called);
}, "window detach inside a navigate event signals event.signal");
</script>