summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html')
-rw-r--r--testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html
new file mode 100644
index 0000000000..015c090bf9
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html
@@ -0,0 +1,16 @@
+<!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 => {
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(navigation.entries()[0], navigation.currentEntry);
+ assert_false(navigation.canGoBack);
+ assert_false(navigation.canGoForward);
+
+ await assertBothRejectDOM(t, navigation.back(), "InvalidStateError");
+ await assertBothRejectDOM(t, navigation.forward(), "InvalidStateError");
+}, "back() and forward() out of bounds");
+</script>