diff options
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-unserializable-state.html')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-unserializable-state.html | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-unserializable-state.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-unserializable-state.html new file mode 100644 index 0000000000..36464ec3c5 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/navigate-unserializable-state.html @@ -0,0 +1,21 @@ +<!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 => { + await assertBothRejectDOM(t, navigation.navigate("#1", { state: new WritableStream() }), "DataCloneError"); + assert_equals(navigation.currentEntry.getState(), undefined); + assert_equals(location.hash, ""); +}, "navigate() with an unserializable state (WritableStream)"); + +promise_test(async t => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const buffer = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + + await assertBothRejectDOM(t, navigation.navigate("#2", { state: buffer }), "DataCloneError"); + assert_equals(navigation.currentEntry.getState(), undefined); + assert_equals(location.hash, ""); +}, "navigate() with an unserializable state (SharedArrayBuffer)"); +</script> |