diff options
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-intercept-rejected.html')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-intercept-rejected.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-intercept-rejected.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-intercept-rejected.html new file mode 100644 index 0000000000..79c8bd803e --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-intercept-rejected.html @@ -0,0 +1,17 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/helpers.js"></script> + +<script> +promise_test(async t => { + const err = new Error("boo!"); + const promise = Promise.reject(err); + promise.catch(() => {}); // prevent unhandled rejection testharness.js errors + navigation.onnavigate = e => e.intercept({ handler: () => promise }); + + const result = navigation.navigate("#1"); + + await assertCommittedFulfillsFinishedRejectsExactly(t, result, navigation.currentEntry, err); +}, "navigate() and intercept() with a rejected promise"); +</script> |