summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-unserializable-state.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-unserializable-state.html')
-rw-r--r--testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-unserializable-state.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-unserializable-state.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-unserializable-state.html
new file mode 100644
index 0000000000..76fa870558
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/reload-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.reload({ state: new WritableStream() }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
+ assert_equals(location.hash, "");
+}, "reload() 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.reload({ state: buffer }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
+ assert_equals(location.hash, "");
+}, "reload() with an unserializable state (SharedArrayBuffer)");
+</script>