forked from mirrors/gecko-dev
Automatic update from web-platform-tests App history API to navigation API rename (3/n) See https://github.com/WICG/navigation-api/issues/83 and https://github.com/WICG/navigation-api/pull/203 for context. This CL is scoped mostly to the third_party/blink/renderer/core/app_history directory. That directory itself has been renamed from app_history to navigation_api. Its contents also follow the new naming. Notably, this includes changing all the IDL interface names and their backing classes, which has minor web-exposed implications. Code outside of that directory is mostly updated due to the change from blink::AppHistory to blink::NavigationApi. References to app history still exist in Blink outside of that directory, as well as within Chromium at large; those will be tackled in a future CL. This also finishes the process of updating the web platform tests, by both updating the actual test code for the interface renames, and updating various test descriptions and comments. Bug: 1300246 Change-Id: I244e5fbb5d7977e8d61edae1e59d7bbfb6bdc75c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522964 Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#981804} -- wpt-commits: 3f00a909b6e15e281fe3dbbac376542465cc5232 wpt-pr: 33184
30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
<!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>
|