2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
6 const err
= new TypeError("a message");
7 let start_href
= location
.href
;
9 navigation
.onnavigatesuccess
= t
.step_func_done(assert_unreached
);
10 navigation
.onnavigateerror
= t
.step_func_done(e
=> {
11 assert_equals(location
.hash
, "#1");
12 assert_equals(e
.constructor, ErrorEvent
);
13 assert_true(e
.error
=== err
);
14 assert_equals(e
.message
, "Uncaught TypeError: a message");
15 assert_equals(e
.filename
, start_href
);
16 assert_greater_than(e
.colno
, 0);
17 assert_greater_than(e
.lineno
, 0);
19 navigation
.onnavigate
= e
=> {
20 e
.transitionWhile(new Promise((resolve
, reject
) => t
.step_timeout(() => reject(err
), 0)));
24 assert_equals(location
.hash
, "#1");
25 }, "AppHistoryNavigateEvent's transitionWhile() should abort if the given promise rejects");