Bug 1757847 [wpt PR 33036] - Update wpt metadata, a=testonly
[gecko.git] / testing / web-platform / tests / app-history / currentchange-event / currentchange-app-history-reload-transitionWhile.html
blobcfa6258dc578de7fe011ed8a938b333ea8e38388
1 <!doctype html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <iframe id="i" src="/common/blank.html"></iframe>
5 <script>
6 promise_test(async t => {
7 await new Promise(resolve => window.onload = resolve);
9 let oncurrententrychange_called = false;
10 i.contentWindow.navigation.oncurrententrychange = t.step_func(e => {
11 oncurrententrychange_called = true;
12 assert_equals(e.from, i.contentWindow.navigation.currentEntry);
13 assert_equals(e.navigationType, "reload");
14 assert_equals(i.contentWindow.navigation.currentEntry.index, 0);
15 });
16 i.contentWindow.navigation.onnavigate = e => e.transitionWhile(Promise.resolve());
17 let result = i.contentWindow.navigation.reload();
18 assert_true(oncurrententrychange_called);
19 await result.committed;
20 }, "AppHistoryCurrentChangeEvent fires for navigation.reload() intercepted by transitionWhile");
21 </script>