2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
6 import { Recorder } from
"./resources/helpers.mjs";
8 promise_test(async t =
> {
9 // Wait for after the load event so that the navigation doesn't get converted
10 // into a replace navigation.
11 await new Promise(resolve =
> window.onload = () =
> t.step_timeout(resolve,
0));
13 const recorder = new Recorder({
14 finalExpectedEvent:
"promise microtask"
17 recorder.setUpAppHistoryListeners();
19 navigation.addEventListener(
"navigate", t.step_func(e =
> {
23 location.href =
"/common/blank.html#1";
25 Promise.resolve().then(() =
> recorder.record(
"promise microtask"));
27 await recorder.readyToAssert;
30 /* event name, location.hash value, navigation.transition properties */
31 [
"navigate",
"", null],
32 [
"AbortSignal abort",
"", null],
33 [
"navigateerror",
"", null],
34 [
"promise microtask",
"", null]
37 recorder.assertErrorsAreAbortErrors();
38 },
"event and promise ordering for the location.href setter where the navigate event is canceled");