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-preventDefault.html - WPT Dashboard Interop Dashboard
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
let abort_signal;
let events = [];
navigation.onnavigateerror = () => events.push("onnavigateerror");
navigation.onnavigate = t.step_func(e => {
abort_signal = e.signal;
abort_signal.onabort = () => events.push("onabort");
e.preventDefault();
});
await promise_rejects_dom(t, 'AbortError', navigation.navigate("?1").committed);
assert_true(abort_signal.aborted);
assert_array_equals(events, ["onabort", "onnavigateerror"]);
}, "event.preventDefault() signals event.signal");
</script>