Skip to content

Commit

Permalink
Bug 1760181 [wpt PR 33182] - App history API to navigation API rename…
Browse files Browse the repository at this point in the history
… (2/n), a=testonly

Automatic update from web-platform-tests
App history API to navigation API rename (2/n)

See WICG/navigation-api#83 and WICG/navigation-api#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
  • Loading branch information
domenic authored and moz-wptsync-bot committed Mar 26, 2022
1 parent 439652b commit cf49f06
Show file tree
Hide file tree
Showing 311 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Overlapping navigation and traversal tests

While developing [app history](https://wicg.github.io/app-history/), @domenic
noticed that cancelation of navigations and history traversals is not very
well-defined in the spec.
While developing the [navigation API](https://wicg.github.io/navigation-api/),
@domenic noticed that cancelation of navigations and history traversals is not
very well-defined in the spec.

On the spec side, this will probably be fixed as part of, or after, the
[session history rewrite](https://github.com/whatwg/html/pull/6315).
Expand Down
2 changes: 1 addition & 1 deletion testing/web-platform/tests/lint.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ PARSE-FAILED: custom-elements/xhtml-crash.xhtml
SET TIMEOUT: *-manual.*
SET TIMEOUT: annotation-model/scripts/ajv.min.js
SET TIMEOUT: apng/animated-png-timeout.html
SET TIMEOUT: app-history/app-history-entry/entries-after-bfcache-in-iframe.html
SET TIMEOUT: cookies/resources/testharness-helpers.js
SET TIMEOUT: common/reftest-wait.js
SET TIMEOUT: conformance-checkers/*
Expand Down Expand Up @@ -186,6 +185,7 @@ SET TIMEOUT: measure-memory/*
SET TIMEOUT: media-source/mediasource-util.js
SET TIMEOUT: media-source/URL-createObjectURL-revoke.html
SET TIMEOUT: mixed-content/generic/sanity-checker.js
SET TIMEOUT: navigation-api/navigation-history-entry/entries-after-bfcache-in-iframe.html
SET TIMEOUT: navigation-timing/*
SET TIMEOUT: old-tests/submission/Microsoft/history/history_000.htm
SET TIMEOUT: paint-timing/resources/subframe-painting.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<script type="module">
promise_setup(async () => {
// Get the overall autofocus processed flag to flip to true, so that
// we only test the app history-specific stuff.
// we only test the navigation API-specific stuff.
await new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)));
assert_equals(document.activeElement, initialAutofocusTarget, "Non-app history autofocus was processed");
assert_equals(document.activeElement, initialAutofocusTarget, "Non-navigation API autofocus was processed");
initialAutofocusTarget.remove();
assert_equals(document.activeElement, document.body);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
assert_false(e.hashChange);
assert_equals(e.formData, null);
assert_equals(new URL(e.destination.url).pathname,
"/app-history/navigate-event/foo.html");
"/navigation-api/navigate-event/foo.html");
assert_false(e.destination.sameDocument);
assert_equals(e.destination.key, null);
assert_equals(e.destination.id, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
assert_false(e.hashChange);
assert_equals(e.formData, null);
assert_equals(new URL(e.destination.url).pathname,
"/app-history/navigate-event/foo.html");
"/navigation-api/navigate-event/foo.html");
assert_false(e.destination.sameDocument);
assert_equals(e.destination.key, null);
assert_equals(e.destination.id, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).pathname,
"/app-history/navigate-event/foo.html");
"/navigation-api/navigate-event/foo.html");
assert_false(e.destination.sameDocument);
assert_equals(e.destination.key, null);
assert_equals(e.destination.id, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
assert_equals(i.contentWindow.navigation.entries().length, 3);
assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
assert_equals(new URL(i.contentWindow.navigation.entries()[0].url).pathname,
"/app-history/app-history-entry/resources/no-referrer-meta.html");
"/navigation-api/navigation-history-entry/resources/no-referrer-meta.html");
assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname,
"/app-history/app-history-entry/resources/no-referrer-meta.html");
"/navigation-api/navigation-history-entry/resources/no-referrer-meta.html");
}, "The url of a document with no-referrer referrer meta tag is censored in AppHistoryEntry");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
assert_equals(i.contentWindow.navigation.entries().length, 3);
assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
assert_equals(new URL(i.contentWindow.navigation.entries()[0].url).pathname,
"/app-history/app-history-entry/resources/no-referrer.html");
"/navigation-api/navigation-history-entry/resources/no-referrer.html");
assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname,
"/app-history/app-history-entry/resources/no-referrer.html");
"/navigation-api/navigation-history-entry/resources/no-referrer.html");
}, "The url of a document with no-referrer referrer policy is censored in AppHistoryEntry");
</script>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# App history ordering/transition tests
# Navigation API ordering/transition tests

These are meant to test the ordering between various events and promises, as
well as in some cases how the `navigation.transition` values changes.

Some of them use the `Recorder` framework in `resources/helpers.mjs`, and others
test tricky cases (e.g. reentrancy) in a more ad-hoc way.

<https://github.com/WICG/app-history/#complete-event-sequence> is a useful
<https://github.com/WICG/navigation-api/#complete-event-sequence> is a useful
reference for the intent of these tests.

Note:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
assert_equals(back_state.statevar, "state");
});
}, 0);
}, "appHistoryEntry.getState() behavior after navigating away and back via a fragment change");
}, "appHistoryEntry.getState() behavior after navigating away using a fragment change, then back");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
});
})();
}, 0);
}, "appHistoryEntry.getState() behavior after navigating away and back");
}, "appHistoryEntry.getState() behavior after navigating away using the navigation API, then back");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");

assert_equals(navigation.currentEntry.getState(), undefined, "App history state starts out as undefined");
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" };
Expand Down

0 comments on commit cf49f06

Please sign in to comment.