forked from mirrors/gecko-dev
Automatic update from web-platform-tests App history API to navigation API rename (2/n) See https://github.com/WICG/navigation-api/issues/83 and https://github.com/WICG/navigation-api/pull/203 for context. This CL renames all test files, with occasional minor updates to their contents. Notably this includes web platform test files. While doing so, some of the web platform tests were slightly moved around to give a clearer directory structure. This revealed some confusing duplication (and in some cases mislocated tests) around state updates, which is tracked in https://crbug.com/1304446. Bug: 1300246 Change-Id: Ieef0329e7a309c242b5391f050878bc182487905 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3510194 Reviewed-by: Nate Chapin <japhet@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/main@{#980702} -- wpt-commits: 4e628b145e52797f421c7f832d13014387aac961 wpt-pr: 33182
25 lines
991 B
HTML
25 lines
991 B
HTML
<!doctype html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<script>
|
|
async_test(t => {
|
|
navigation.onnavigate = t.unreached_func("navigate must not fire");
|
|
navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
|
|
navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");
|
|
|
|
assert_equals(navigation.currentEntry.getState(), undefined, "Navigation API state starts out as undefined");
|
|
assert_equals(history.state, null, "history.state starts out as null");
|
|
|
|
const newState = { key: "value" };
|
|
|
|
navigation.updateCurrentEntry({ state: newState });
|
|
|
|
assert_equals(navigation.currentEntry.getState().key, "value");
|
|
assert_not_equals(navigation.currentEntry.getState(), newState);
|
|
assert_equals(history.state, null);
|
|
|
|
// Wait a tick to make sure no events fire asynchronously.
|
|
t.step_timeout(() => t.done(), 0);
|
|
}, "updateCurrentEntry() works as expected");
|
|
</script>
|