From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- .../ordering-and-transition/README.md | 26 +++ .../anchor-download-intercept-reject.html | 54 ++++++ .../anchor-download-intercept.html | 48 +++++ .../ordering-and-transition/anchor-download.html | 24 +++ .../back-same-document-intercept-reject.html | 54 ++++++ .../back-same-document-intercept.html | 48 +++++ .../back-same-document.html | 40 +++++ ...rrententrychange-before-popstate-intercept.html | 48 +++++ .../currententrychange-dispose-ordering.html | 26 +++ .../ordering-and-transition/intercept-async.html | 55 ++++++ .../location-href-canceled.html | 39 +++++ .../location-href-double-intercept.html | 61 +++++++ .../location-href-intercept-reentrant.html | 60 +++++++ .../location-href-intercept-reject.html | 50 ++++++ .../location-href-intercept.html | 44 +++++ ...vigate-204-205-download-then-same-document.html | 66 +++++++ .../ordering-and-transition/navigate-canceled.html | 42 +++++ ...navigate-commit-after-transition-intercept.html | 60 +++++++ .../navigate-cross-document-double.html | 52 ++++++ .../navigate-cross-document-event-order.html | 32 ++++ .../navigate-double-intercept.html | 68 ++++++++ .../navigate-in-transition-finished.html | 69 ++++++++ .../navigate-intercept-stop.html | 52 ++++++ .../navigate-intercept.html | 47 +++++ ...navigate-same-document-intercept-reentrant.html | 66 +++++++ .../navigate-same-document-intercept-reject.html | 53 ++++++ .../navigate-same-document.html | 39 +++++ .../ordering-and-transition/reload-canceled.html | 42 +++++ .../reload-intercept-reject.html | 53 ++++++ .../ordering-and-transition/reload-intercept.html | 47 +++++ .../ordering-and-transition/resources/helpers.mjs | 193 +++++++++++++++++++++ .../resources/notify-top-early.html | 6 + .../transition-cross-document.html | 44 +++++ .../transition-finished-mark-as-handled.html | 20 +++ .../transition-realms-and-identity.html | 41 +++++ 35 files changed, 1769 insertions(+) create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/README.md create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept-reject.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept-reject.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-before-popstate-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/intercept-async.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-canceled.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-double-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reentrant.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reject.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-204-205-download-then-same-document.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-canceled.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-commit-after-transition-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-double.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-event-order.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-double-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-in-transition-finished.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept-stop.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reentrant.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reject.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/reload-canceled.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept-reject.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/resources/helpers.mjs create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/resources/notify-top-early.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/transition-cross-document.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/transition-finished-mark-as-handled.html create mode 100644 testing/web-platform/tests/navigation-api/ordering-and-transition/transition-realms-and-identity.html (limited to 'testing/web-platform/tests/navigation-api/ordering-and-transition') diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/README.md b/testing/web-platform/tests/navigation-api/ordering-and-transition/README.md new file mode 100644 index 0000000000..628b22ec48 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/README.md @@ -0,0 +1,26 @@ +# 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. + + is a useful +reference for the intent of these tests. + +Note: + +* Variants specifically exist for `currententrychange` because an event listener + existing for `currententrychange` causes code to run, and thus microtasks to run, + at a very specific point in the navigation-commit lifecycle. We want to test + that it doesn't impact the ordering. +* Similarly we test that `intercept()` does not change + the ordering compared to no `intercept()` call, for same-document + navigations, by trying to ensure most variants have appropriate + `intercept()` counterparts with similar orderings. + +TODOs: + +* Also test `popstate` and `hashchange` once + is fixed. diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept-reject.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept-reject.html new file mode 100644 index 0000000000..4869cedd25 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept-reject.html @@ -0,0 +1,54 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept.html new file mode 100644 index 0000000000..23326c827b --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download-intercept.html @@ -0,0 +1,48 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download.html new file mode 100644 index 0000000000..c6af13c3e0 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/anchor-download.html @@ -0,0 +1,24 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept-reject.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept-reject.html new file mode 100644 index 0000000000..c0d4f55027 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept-reject.html @@ -0,0 +1,54 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept.html new file mode 100644 index 0000000000..7bd248bc9c --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document-intercept.html @@ -0,0 +1,48 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document.html new file mode 100644 index 0000000000..76c3e99311 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/back-same-document.html @@ -0,0 +1,40 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-before-popstate-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-before-popstate-intercept.html new file mode 100644 index 0000000000..c51c7c444c --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-before-popstate-intercept.html @@ -0,0 +1,48 @@ + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html new file mode 100644 index 0000000000..4ca9ba2980 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html @@ -0,0 +1,26 @@ + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/intercept-async.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/intercept-async.html new file mode 100644 index 0000000000..f2ca096950 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/intercept-async.html @@ -0,0 +1,55 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-canceled.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-canceled.html new file mode 100644 index 0000000000..eef10cd173 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-canceled.html @@ -0,0 +1,39 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-double-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-double-intercept.html new file mode 100644 index 0000000000..36ae5ce4ab --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-double-intercept.html @@ -0,0 +1,61 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reentrant.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reentrant.html new file mode 100644 index 0000000000..3fabf52bfb --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reentrant.html @@ -0,0 +1,60 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reject.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reject.html new file mode 100644 index 0000000000..b4aeb726b3 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept-reject.html @@ -0,0 +1,50 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept.html new file mode 100644 index 0000000000..bb861d37ae --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/location-href-intercept.html @@ -0,0 +1,44 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-204-205-download-then-same-document.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-204-205-download-then-same-document.html new file mode 100644 index 0000000000..b7b6283fa7 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-204-205-download-then-same-document.html @@ -0,0 +1,66 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-canceled.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-canceled.html new file mode 100644 index 0000000000..2604a60e37 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-canceled.html @@ -0,0 +1,42 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-commit-after-transition-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-commit-after-transition-intercept.html new file mode 100644 index 0000000000..70a840e692 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-commit-after-transition-intercept.html @@ -0,0 +1,60 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-double.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-double.html new file mode 100644 index 0000000000..262809a0ad --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-double.html @@ -0,0 +1,52 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-event-order.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-event-order.html new file mode 100644 index 0000000000..34a9b79fb5 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-cross-document-event-order.html @@ -0,0 +1,32 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-double-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-double-intercept.html new file mode 100644 index 0000000000..6ce67b9af6 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-double-intercept.html @@ -0,0 +1,68 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-in-transition-finished.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-in-transition-finished.html new file mode 100644 index 0000000000..9251cfe049 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-in-transition-finished.html @@ -0,0 +1,69 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept-stop.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept-stop.html new file mode 100644 index 0000000000..5d126a8c2f --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept-stop.html @@ -0,0 +1,52 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept.html new file mode 100644 index 0000000000..f76f20bf85 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-intercept.html @@ -0,0 +1,47 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reentrant.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reentrant.html new file mode 100644 index 0000000000..86f4e06731 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reentrant.html @@ -0,0 +1,66 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reject.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reject.html new file mode 100644 index 0000000000..88c668e0e9 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document-intercept-reject.html @@ -0,0 +1,53 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document.html new file mode 100644 index 0000000000..589e1105e6 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/navigate-same-document.html @@ -0,0 +1,39 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-canceled.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-canceled.html new file mode 100644 index 0000000000..3e9e24e777 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-canceled.html @@ -0,0 +1,42 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept-reject.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept-reject.html new file mode 100644 index 0000000000..334d2108ec --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept-reject.html @@ -0,0 +1,53 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept.html new file mode 100644 index 0000000000..8d4160a4d9 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/reload-intercept.html @@ -0,0 +1,47 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/helpers.mjs b/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/helpers.mjs new file mode 100644 index 0000000000..341befc105 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/helpers.mjs @@ -0,0 +1,193 @@ +const variants = new Set((new URLSearchParams(location.search)).keys()); + +export function hasVariant(name) { + return variants.has(name); +} + +export class Recorder { + #events = []; + #errors = []; + #navigationAPI; + #domExceptionConstructor; + #location; + #skipCurrentChange; + #finalExpectedEvent; + #finalExpectedEventCount; + #currentFinalEventCount = 0; + + #readyToAssertResolve; + #readyToAssertPromise = new Promise(resolve => { this.#readyToAssertResolve = resolve; }); + + constructor({ window = self, skipCurrentChange = false, finalExpectedEvent, finalExpectedEventCount = 1 }) { + assert_equals(typeof finalExpectedEvent, "string", "Must pass a string for finalExpectedEvent"); + + this.#navigationAPI = window.navigation; + this.#domExceptionConstructor = window.DOMException; + this.#location = window.location; + + this.#skipCurrentChange = skipCurrentChange; + this.#finalExpectedEvent = finalExpectedEvent; + this.#finalExpectedEventCount = finalExpectedEventCount; + } + + setUpNavigationAPIListeners() { + this.#navigationAPI.addEventListener("navigate", e => { + this.record("navigate"); + + e.signal.addEventListener("abort", () => { + this.recordWithError("AbortSignal abort", e.signal.reason); + }); + }); + + this.#navigationAPI.addEventListener("navigateerror", e => { + this.recordWithError("navigateerror", e.error); + + this.#navigationAPI.transition?.finished.then( + () => this.record("transition.finished fulfilled"), + err => this.recordWithError("transition.finished rejected", err) + ); + }); + + this.#navigationAPI.addEventListener("navigatesuccess", () => { + this.record("navigatesuccess"); + + this.#navigationAPI.transition?.finished.then( + () => this.record("transition.finished fulfilled"), + err => this.recordWithError("transition.finished rejected", err) + ); + }); + + if (!this.#skipCurrentChange) { + this.#navigationAPI.addEventListener("currententrychange", () => this.record("currententrychange")); + } + } + + setUpResultListeners(result, suffix = "") { + result.committed.then( + () => this.record(`committed fulfilled${suffix}`), + err => this.recordWithError(`committed rejected${suffix}`, err) + ); + + result.finished.then( + () => this.record(`finished fulfilled${suffix}`), + err => this.recordWithError(`finished rejected${suffix}`, err) + ); + } + + record(name) { + const transitionProps = this.#navigationAPI.transition === null ? null : { + from: this.#navigationAPI.transition.from, + navigationType: this.#navigationAPI.transition.navigationType + }; + + this.#events.push({ name, location: this.#location.hash, transitionProps }); + + if (name === this.#finalExpectedEvent && ++this.#currentFinalEventCount === this.#finalExpectedEventCount) { + this.#readyToAssertResolve(); + } + } + + recordWithError(name, errorObject) { + this.record(name); + this.#errors.push({ name, errorObject }); + } + + get readyToAssert() { + return this.#readyToAssertPromise; + } + + // Usage: + // recorder.assert([ + // /* event name, location.hash value, navigation.transition properties */ + // ["currententrychange", "", null], + // ["committed fulfilled", "#1", { from, navigationType }], + // ... + // ]); + // + // The array format is to avoid repitition at the call site, but I recommend + // you document it like above. + // + // This will automatically also assert that any error objects recorded are + // equal to each other. Use the other assert functions to check the actual + // contents of the error objects. + assert(expectedAsArray) { + if (this.#skipCurrentChange) { + expectedAsArray = expectedAsArray.filter(expected => expected[0] !== "currententrychange"); + } + + // Doing this up front gives nicer error messages because + // assert_array_equals is nice. + const recordedNames = this.#events.map(e => e.name); + const expectedNames = expectedAsArray.map(e => e[0]); + assert_array_equals(recordedNames, expectedNames); + + for (let i = 0; i < expectedAsArray.length; ++i) { + const recorded = this.#events[i]; + const expected = expectedAsArray[i]; + + assert_equals( + recorded.location, + expected[1], + `event ${i} (${recorded.name}): location.hash value` + ); + + if (expected[2] === null) { + assert_equals( + recorded.transitionProps, + null, + `event ${i} (${recorded.name}): navigation.transition expected to be null` + ); + } else { + assert_not_equals( + recorded.transitionProps, + null, + `event ${i} (${recorded.name}): navigation.transition expected not to be null` + ); + assert_equals( + recorded.transitionProps.from, + expected[2].from, + `event ${i} (${recorded.name}): navigation.transition.from` + ); + assert_equals( + recorded.transitionProps.navigationType, + expected[2].navigationType, + `event ${i} (${recorded.name}): navigation.transition.navigationType` + ); + } + } + + if (this.#errors.length > 1) { + for (let i = 1; i < this.#errors.length; ++i) { + assert_equals( + this.#errors[i].errorObject, + this.#errors[0].errorObject, + `error objects must match: error object for ${this.#errors[i].name} did not match the one for ${this.#errors[0].name}` + ); + } + } + } + + assertErrorsAreAbortErrors() { + assert_greater_than( + this.#errors.length, + 0, + "No errors were recorded but assertErrorsAreAbortErrors() was called" + ); + + // Assume assert() has been called so all error objects are the same. + const { errorObject } = this.#errors[0]; + assert_throws_dom("AbortError", this.#domExceptionConstructor, () => { throw errorObject; }); + } + + assertErrorsAre(expectedErrorObject) { + assert_greater_than( + this.#errors.length, + 0, + "No errors were recorded but assertErrorsAre() was called" + ); + + // Assume assert() has been called so all error objects are the same. + const { errorObject } = this.#errors[0]; + assert_equals(errorObject, expectedErrorObject); + } +} diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/notify-top-early.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/notify-top-early.html new file mode 100644 index 0000000000..0dd796f609 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/resources/notify-top-early.html @@ -0,0 +1,6 @@ + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-cross-document.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-cross-document.html new file mode 100644 index 0000000000..4a14a1083d --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-cross-document.html @@ -0,0 +1,44 @@ + + + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-finished-mark-as-handled.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-finished-mark-as-handled.html new file mode 100644 index 0000000000..fa38b82216 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-finished-mark-as-handled.html @@ -0,0 +1,20 @@ + + + + + diff --git a/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-realms-and-identity.html b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-realms-and-identity.html new file mode 100644 index 0000000000..f1b3ead980 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/ordering-and-transition/transition-realms-and-identity.html @@ -0,0 +1,41 @@ + + + + + + + -- cgit v1.2.3