diff options
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html b/testing/web-platform/tests/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html new file mode 100644 index 0000000000..a197f825d8 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html @@ -0,0 +1,30 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +async_test(t => { + // Wait for after the load event so that the navigation doesn't get converted + // into a replace navigation. + window.onload = () => t.step_timeout(t.step_func_done(() => { + let entry1 = navigation.currentEntry; + assert_true(entry1.sameDocument); + + location = "#hash"; + let entry2 = navigation.currentEntry; + assert_not_equals(entry1, entry2); + assert_true(entry1.sameDocument); + + history.pushState("push", "", "#push"); + let entry3 = navigation.currentEntry; + assert_not_equals(entry1, entry3); + assert_not_equals(entry2, entry3); + assert_true(entry1.sameDocument); + assert_true(entry2.sameDocument); + + assert_equals(navigation.entries().length, 3); + assert_equals(navigation.entries()[0], entry1); + assert_equals(navigation.entries()[1], entry2); + assert_equals(navigation.entries()[2], entry3); + }), 0); +}, "entry.sameDocument after same-document navigations"); +</script> |