chromium/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/return-value/back-forward-out-of-bounds.html

<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/helpers.js"></script>
<iframe id="i" src="/common/blank.html"></iframe>
<script>
promise_test(async t => {
  await new Promise(resolve => window.onload = resolve);
  assert_equals(i.contentWindow.navigation.entries().length, 1);
  assert_equals(i.contentWindow.navigation.entries()[0], i.contentWindow.navigation.currentEntry);
  assert_false(i.contentWindow.navigation.canGoBack);
  assert_false(i.contentWindow.navigation.canGoForward);

  await assertBothRejectDOM(t, i.contentWindow.navigation.back(), "InvalidStateError", i.contentWindow);
  await assertBothRejectDOM(t, i.contentWindow.navigation.forward(), "InvalidStateError", i.contentWindow);
}, "back() and forward() out of bounds");
</script>