Bug 1760181 [wpt PR 33182] - App history API to navigation API rename (2/n), a=testonly
[gecko.git] / testing / web-platform / tests / navigation-api / navigation-history-entry / key-id-location-reload-transitionWhile.html
bloba06b645fa6f2f190cb91d4f8bb462a79c972db4e
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; });
10 const original = i.contentWindow.navigation.currentEntry;
11 const { key, id } = original;
13 i.contentWindow.navigation.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
15 i.onload = t.unreached_func("the iframe must not reload");
17 await i.contentWindow.location.reload();
19 assert_equals(i.contentWindow.navigation.currentEntry, original);
20 assert_equals(i.contentWindow.navigation.currentEntry.key, key);
21 assert_equals(i.contentWindow.navigation.currentEntry.id, id);
22 }, "AppHistoryEntry's key and id after location.reload() intercepted by transitionWhile()");
23 </script>