diff options
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigate-event/signal-abort-preventDefault.html')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigate-event/signal-abort-preventDefault.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/signal-abort-preventDefault.html b/testing/web-platform/tests/navigation-api/navigate-event/signal-abort-preventDefault.html new file mode 100644 index 0000000000..60fed90ce6 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigate-event/signal-abort-preventDefault.html @@ -0,0 +1,19 @@ +<!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> |