diff options
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-intercept-rejected.html')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-intercept-rejected.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-intercept-rejected.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-intercept-rejected.html new file mode 100644 index 0000000000..93cd75c2b9 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-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.reload(); + + await assertCommittedFulfillsFinishedRejectsExactly(t, result, navigation.currentEntry, err); +}, "reload() and intercept() with a rejected promise"); +</script> |