summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html')
-rw-r--r--testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html
new file mode 100644
index 0000000000..dfdb6611ab
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-initial-about-blank.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/helpers.js"></script>
+
+<body>
+<script>
+promise_test(async t => {
+ let i = document.createElement("iframe");
+ document.body.append(i);
+
+ i.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+
+ // Since there's no way to do a non-replacement navigation on the initial
+ // about:blank, there's no way to actually get in a situation where we're on
+ // about:blank but there's something else backward/forward in the history
+ // list. So this test will almost certainly pass just because there's nothing
+ // to go back/forward to. Oh well; it's still reasonable coverage.
+
+ await assertBothRejectDOM(t, i.contentWindow.navigation.back(), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.forward(), "InvalidStateError", i.contentWindow);
+}, "back() and forward() in initial about:blank document");
+</script>