diff --git a/app-history/README.md b/app-history/README.md new file mode 100644 index 00000000000000..068ae5b7114745 --- /dev/null +++ b/app-history/README.md @@ -0,0 +1,11 @@ +# Navigation API tests + +This directory contains tests for the +[navigation API](https://wicg.github.io/navigation-api/), +[formerly known as](https://github.com/WICG/navigation-api/issues/83) the app +history API. + +The tests are currently being updated for the rename, and so are likely to have +filenames, descriptions, etc. which don't match the spec, or mismatch the +contents of the test. The rename is being done in stages and tracked at +. diff --git a/app-history/app-history-entry/after-detach.html b/app-history/app-history-entry/after-detach.html index 07591f96ae51c4..c4ecfec44d69ea 100644 --- a/app-history/app-history-entry/after-detach.html +++ b/app-history/app-history-entry/after-detach.html @@ -8,23 +8,23 @@ // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - let i_appHistory = i.contentWindow.appHistory; + let i_navigation = i.contentWindow.navigation; - await i_appHistory.navigate("#1").finished; - await i_appHistory.navigate("#2").finished; - await i_appHistory.back().finished; + await i_navigation.navigate("#1").finished; + await i_navigation.navigate("#2").finished; + await i_navigation.back().finished; - assert_not_equals(i_appHistory, null); - assert_not_equals(i_appHistory.current, null); - assert_equals(i_appHistory.entries().length, 3); - assert_true(i_appHistory.canGoBack, "canGoBack"); - assert_true(i_appHistory.canGoForward, "canGoForward"); + assert_not_equals(i_navigation, null); + assert_not_equals(i_navigation.currentEntry, null); + assert_equals(i_navigation.entries().length, 3); + assert_true(i_navigation.canGoBack, "canGoBack"); + assert_true(i_navigation.canGoForward, "canGoForward"); i.remove(); - assert_equals(i_appHistory.current, null); - assert_equals(i_appHistory.entries().length, 0); - assert_false(i_appHistory.canGoBack); - assert_false(i_appHistory.canGoForward); -}, "appHistory.current/entries()/canGoBack/canGoForward after iframe removal"); + assert_equals(i_navigation.currentEntry, null); + assert_equals(i_navigation.entries().length, 0); + assert_false(i_navigation.canGoBack); + assert_false(i_navigation.canGoForward); +}, "navigation.currentEntry/entries()/canGoBack/canGoForward after iframe removal"); diff --git a/app-history/app-history-entry/current-basic.html b/app-history/app-history-entry/current-basic.html index 102fbbb270d7e1..78bbbb05607c3b 100644 --- a/app-history/app-history-entry/current-basic.html +++ b/app-history/app-history-entry/current-basic.html @@ -4,7 +4,7 @@ diff --git a/app-history/app-history-entry/entries-across-origins.html b/app-history/app-history-entry/entries-across-origins.html index b6e8e9ee7340ea..447273bff2c844 100644 --- a/app-history/app-history-entry/entries-across-origins.html +++ b/app-history/app-history-entry/entries-across-origins.html @@ -7,8 +7,8 @@ diff --git a/app-history/app-history-entry/entries-after-bfcache-in-iframe.html b/app-history/app-history-entry/entries-after-bfcache-in-iframe.html index 5644d12a340909..b54a74995099ea 100644 --- a/app-history/app-history-entry/entries-after-bfcache-in-iframe.html +++ b/app-history/app-history-entry/entries-after-bfcache-in-iframe.html @@ -7,10 +7,10 @@ diff --git a/app-history/app-history-entry/entries-after-javascript-url-navigation.html b/app-history/app-history-entry/entries-after-javascript-url-navigation.html index 2ed1d81fe94e9e..27a07c9e55d37c 100644 --- a/app-history/app-history-entry/entries-after-javascript-url-navigation.html +++ b/app-history/app-history-entry/entries-after-javascript-url-navigation.html @@ -5,34 +5,34 @@ diff --git a/app-history/app-history-entry/entries-after-navigations-in-multiple-windows.html b/app-history/app-history-entry/entries-after-navigations-in-multiple-windows.html index 55cb58ea0022d6..d1d4d86eb382ca 100644 --- a/app-history/app-history-entry/entries-after-navigations-in-multiple-windows.html +++ b/app-history/app-history-entry/entries-after-navigations-in-multiple-windows.html @@ -5,7 +5,7 @@ diff --git a/app-history/app-history-entry/entries-after-srcdoc-navigation.html b/app-history/app-history-entry/entries-after-srcdoc-navigation.html index cfb1337cabfb62..434b376224c6bd 100644 --- a/app-history/app-history-entry/entries-after-srcdoc-navigation.html +++ b/app-history/app-history-entry/entries-after-srcdoc-navigation.html @@ -7,7 +7,7 @@ async_test(t => { window.onload = t.step_func(() => { i.onload = t.step_func_done(() => { - let entries = i.contentWindow.appHistory.entries(); + let entries = i.contentWindow.navigation.entries(); assert_equals(entries.length, 2); assert_not_equals(entries[1].key, entries[0].key); assert_not_equals(entries[1].url, entries[0].url); diff --git a/app-history/app-history-entry/entries-array-equality.html b/app-history/app-history-entry/entries-array-equality.html index e6eb99863d037f..98efb6b20c0a1e 100644 --- a/app-history/app-history-entry/entries-array-equality.html +++ b/app-history/app-history-entry/entries-array-equality.html @@ -3,6 +3,6 @@ diff --git a/app-history/app-history-entry/entries-in-new-javascript-url-iframe.html b/app-history/app-history-entry/entries-in-new-javascript-url-iframe.html index de7d68173cc1fe..cd4279a7f31fb4 100644 --- a/app-history/app-history-entry/entries-in-new-javascript-url-iframe.html +++ b/app-history/app-history-entry/entries-in-new-javascript-url-iframe.html @@ -7,9 +7,9 @@ promise_test(async t => { await new Promise(resolve => window.onload = resolve); - assert_not_equals(i.contentWindow.appHistory.current, null); - assert_array_equals(i.contentWindow.appHistory.entries(), [i.contentWindow.appHistory.current]); + assert_not_equals(i.contentWindow.navigation.currentEntry, null); + assert_array_equals(i.contentWindow.navigation.entries(), [i.contentWindow.navigation.currentEntry]); - assert_equals(i.contentWindow.appHistory.current.url, "about:blank"); -}, "AppHistory entries() and current should be set in a new javascript: URL iframe"); + assert_equals(i.contentWindow.navigation.currentEntry.url, "about:blank"); +}, "AppHistory entries() and currentEntry should be set in a new javascript: URL iframe"); diff --git a/app-history/app-history-entry/entries-in-new-srcdoc-iframe.html b/app-history/app-history-entry/entries-in-new-srcdoc-iframe.html index 7ef6b4d511fce4..d261efd0778a78 100644 --- a/app-history/app-history-entry/entries-in-new-srcdoc-iframe.html +++ b/app-history/app-history-entry/entries-in-new-srcdoc-iframe.html @@ -7,9 +7,9 @@ promise_test(async t => { await new Promise(resolve => window.onload = resolve); - assert_not_equals(i.contentWindow.appHistory.current, null); - assert_array_equals(i.contentWindow.appHistory.entries(), [i.contentWindow.appHistory.current]); + assert_not_equals(i.contentWindow.navigation.currentEntry, null); + assert_array_equals(i.contentWindow.navigation.entries(), [i.contentWindow.navigation.currentEntry]); - assert_equals(i.contentWindow.appHistory.current.url, "about:srcdoc"); -}, "AppHistory entries() and current should be set in a new srcdoc iframe"); + assert_equals(i.contentWindow.navigation.currentEntry.url, "about:srcdoc"); +}, "AppHistory entries() and currentEntry should be set in a new srcdoc iframe"); diff --git a/app-history/app-history-entry/entries-when-inactive.html b/app-history/app-history-entry/entries-when-inactive.html index a7073778fb5aeb..c70b6d8bf870fb 100644 --- a/app-history/app-history-entry/entries-when-inactive.html +++ b/app-history/app-history-entry/entries-when-inactive.html @@ -3,14 +3,14 @@ diff --git a/app-history/app-history-entry/entry-after-detach.html b/app-history/app-history-entry/entry-after-detach.html index dc31f1a695b013..83962d2a8e1462 100644 --- a/app-history/app-history-entry/entry-after-detach.html +++ b/app-history/app-history-entry/entry-after-detach.html @@ -5,7 +5,7 @@ diff --git a/app-history/app-history-entry/key-id-back-same-document.html b/app-history/app-history-entry/key-id-back-same-document.html index 94319c3592e08a..b5137f3e51bfcc 100644 --- a/app-history/app-history-entry/key-id-back-same-document.html +++ b/app-history/app-history-entry/key-id-back-same-document.html @@ -3,21 +3,21 @@ diff --git a/app-history/app-history-entry/key-id-location-reload.html b/app-history/app-history-entry/key-id-location-reload.html index 660427011d43eb..267906d2c38cc4 100644 --- a/app-history/app-history-entry/key-id-location-reload.html +++ b/app-history/app-history-entry/key-id-location-reload.html @@ -5,13 +5,13 @@ diff --git a/app-history/app-history-entry/no-referrer-from-meta-url-censored.html b/app-history/app-history-entry/no-referrer-from-meta-url-censored.html index 0f23f3b539b064..e23c58ae0e7200 100644 --- a/app-history/app-history-entry/no-referrer-from-meta-url-censored.html +++ b/app-history/app-history-entry/no-referrer-from-meta-url-censored.html @@ -8,25 +8,25 @@ // into a replace navigation. await new Promise(r => window.onload = () => t.step_timeout(r, 0)); - await i.contentWindow.appHistory.navigate("#hash"); - assert_equals(i.contentWindow.appHistory.entries().length, 2); + await i.contentWindow.navigation.navigate("#hash"); + assert_equals(i.contentWindow.navigation.entries().length, 2); // The entries for no-referrer.html should have the url censored. - i.contentWindow.appHistory.navigate("/common/blank.html"); + i.contentWindow.navigation.navigate("/common/blank.html"); await new Promise(r => i.onload = () => t.step_timeout(r, 0)); - assert_equals(i.contentWindow.appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.current.index, 2); - assert_equals(i.contentWindow.appHistory.entries()[0].url, null); - assert_equals(i.contentWindow.appHistory.entries()[1].url, null); + assert_equals(i.contentWindow.navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.currentEntry.index, 2); + assert_equals(i.contentWindow.navigation.entries()[0].url, null); + assert_equals(i.contentWindow.navigation.entries()[1].url, null); // Navigating back to no-referrer.html should uncensor the urls. - i.contentWindow.appHistory.back(); + i.contentWindow.navigation.back(); await new Promise(r => i.onload = () => t.step_timeout(r, 0)); - assert_equals(i.contentWindow.appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.current.index, 1); - assert_equals(new URL(i.contentWindow.appHistory.entries()[0].url).pathname, + assert_equals(i.contentWindow.navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); + assert_equals(new URL(i.contentWindow.navigation.entries()[0].url).pathname, "/app-history/app-history-entry/resources/no-referrer-meta.html"); - assert_equals(new URL(i.contentWindow.appHistory.entries()[1].url).pathname, + assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname, "/app-history/app-history-entry/resources/no-referrer-meta.html"); }, "The url of a document with no-referrer referrer meta tag is censored in AppHistoryEntry"); diff --git a/app-history/app-history-entry/no-referrer-url-censored.html b/app-history/app-history-entry/no-referrer-url-censored.html index 2db425368f6a04..f7a5547a265320 100644 --- a/app-history/app-history-entry/no-referrer-url-censored.html +++ b/app-history/app-history-entry/no-referrer-url-censored.html @@ -8,25 +8,25 @@ // into a replace navigation. await new Promise(r => window.onload = () => t.step_timeout(r, 0)); - await i.contentWindow.appHistory.navigate("#hash"); - assert_equals(i.contentWindow.appHistory.entries().length, 2); + await i.contentWindow.navigation.navigate("#hash"); + assert_equals(i.contentWindow.navigation.entries().length, 2); // The entries for no-referrer.html should have the url censored. - i.contentWindow.appHistory.navigate("/common/blank.html"); + i.contentWindow.navigation.navigate("/common/blank.html"); await new Promise(r => i.onload = () => t.step_timeout(r, 0)); - assert_equals(i.contentWindow.appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.current.index, 2); - assert_equals(i.contentWindow.appHistory.entries()[0].url, null); - assert_equals(i.contentWindow.appHistory.entries()[1].url, null); + assert_equals(i.contentWindow.navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.currentEntry.index, 2); + assert_equals(i.contentWindow.navigation.entries()[0].url, null); + assert_equals(i.contentWindow.navigation.entries()[1].url, null); // Navigating back to no-referrer.html should uncensor the urls. - i.contentWindow.appHistory.back(); + i.contentWindow.navigation.back(); await new Promise(r => i.onload = () => t.step_timeout(r, 0)); - assert_equals(i.contentWindow.appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.current.index, 1); - assert_equals(new URL(i.contentWindow.appHistory.entries()[0].url).pathname, + assert_equals(i.contentWindow.navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); + assert_equals(new URL(i.contentWindow.navigation.entries()[0].url).pathname, "/app-history/app-history-entry/resources/no-referrer.html"); - assert_equals(new URL(i.contentWindow.appHistory.entries()[1].url).pathname, + assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname, "/app-history/app-history-entry/resources/no-referrer.html"); }, "The url of a document with no-referrer referrer policy is censored in AppHistoryEntry"); diff --git a/app-history/app-history-entry/opaque-origin-data-url.html b/app-history/app-history-entry/opaque-origin-data-url.html index a1e765dd1bb75f..3275a30ef420f7 100644 --- a/app-history/app-history-entry/opaque-origin-data-url.html +++ b/app-history/app-history-entry/opaque-origin-data-url.html @@ -9,8 +9,8 @@ assert_equals(e.data.length, 0); assert_true(e.data.currentIsNull); }); - i.src = "data:text/html, diff --git a/app-history/app-history-entry/resources/opaque-origin-page.html b/app-history/app-history-entry/resources/opaque-origin-page.html index 5e8a71981c5f6c..98e2c1b3175722 100644 --- a/app-history/app-history-entry/resources/opaque-origin-page.html +++ b/app-history/app-history-entry/resources/opaque-origin-page.html @@ -17,9 +17,9 @@ assert_equals(location.hash, "#1"); - assert_equals(appHistory.current, null); - assert_equals(appHistory.entries().length, 0); - assert_false(appHistory.canGoBack); - assert_false(appHistory.canGoForward); -}, "appHistory.current/entries()/canGoBack/canGoForward in an opaque origin iframe"); + assert_equals(navigation.currentEntry, null); + assert_equals(navigation.entries().length, 0); + assert_false(navigation.canGoBack); + assert_false(navigation.canGoForward); +}, "navigation.currentEntry/entries()/canGoBack/canGoForward in an opaque origin iframe"); diff --git a/app-history/app-history-entry/resources/post-entries-length-to-top.html b/app-history/app-history-entry/resources/post-entries-length-to-top.html index 348a8984fe1019..c8fe005d8ef090 100644 --- a/app-history/app-history-entry/resources/post-entries-length-to-top.html +++ b/app-history/app-history-entry/resources/post-entries-length-to-top.html @@ -3,5 +3,5 @@ diff --git a/app-history/app-history-entry/resources/post-key-to-top.html b/app-history/app-history-entry/resources/post-key-to-top.html index 023141f76a3a06..285f345dc1fc5c 100644 --- a/app-history/app-history-entry/resources/post-key-to-top.html +++ b/app-history/app-history-entry/resources/post-key-to-top.html @@ -1,3 +1,3 @@ diff --git a/app-history/app-history-entry/sameDocument-after-fragment-navigate.html b/app-history/app-history-entry/sameDocument-after-fragment-navigate.html index 732b10964efe99..acb67ee72c7055 100644 --- a/app-history/app-history-entry/sameDocument-after-fragment-navigate.html +++ b/app-history/app-history-entry/sameDocument-after-fragment-navigate.html @@ -6,25 +6,25 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(t.step_func_done(() => { - let entry1 = appHistory.current; + let entry1 = navigation.currentEntry; assert_true(entry1.sameDocument); location = "#hash"; - let entry2 = appHistory.current; + let entry2 = navigation.currentEntry; assert_not_equals(entry1, entry2); assert_true(entry1.sameDocument); history.pushState("push", "", "#push"); - let entry3 = appHistory.current; + let entry3 = navigation.currentEntry; assert_not_equals(entry1, entry3); assert_not_equals(entry2, entry3); assert_true(entry1.sameDocument); assert_true(entry2.sameDocument); - assert_equals(appHistory.entries().length, 3); - assert_equals(appHistory.entries()[0], entry1); - assert_equals(appHistory.entries()[1], entry2); - assert_equals(appHistory.entries()[2], entry3); + assert_equals(navigation.entries().length, 3); + assert_equals(navigation.entries()[0], entry1); + assert_equals(navigation.entries()[1], entry2); + assert_equals(navigation.entries()[2], entry3); }), 0); }, "AppHistoryEntry.sameDocument after same-document navigations"); diff --git a/app-history/app-history-entry/sameDocument-after-navigate-restore.html b/app-history/app-history-entry/sameDocument-after-navigate-restore.html index 0c8abb4eb0b0e9..fd21bc222f4c5d 100644 --- a/app-history/app-history-entry/sameDocument-after-navigate-restore.html +++ b/app-history/app-history-entry/sameDocument-after-navigate-restore.html @@ -5,21 +5,21 @@ diff --git a/app-history/app-history-entry/sameDocument-after-navigate.html b/app-history/app-history-entry/sameDocument-after-navigate.html index 1e984b336a671c..e1376a07f25502 100644 --- a/app-history/app-history-entry/sameDocument-after-navigate.html +++ b/app-history/app-history-entry/sameDocument-after-navigate.html @@ -5,7 +5,7 @@ diff --git a/app-history/currentchange-event/currentchange-anchor-href.html b/app-history/currentchange-event/currentchange-anchor-href.html index 2a93abf9937942..55e45561351ff1 100644 --- a/app-history/currentchange-event/currentchange-anchor-href.html +++ b/app-history/currentchange-event/currentchange-anchor-href.html @@ -4,15 +4,15 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-back-forward-cross-doc.html b/app-history/currentchange-event/currentchange-app-history-back-forward-cross-doc.html index 7782d11b0c31a5..df230bd9acb5da 100644 --- a/app-history/currentchange-event/currentchange-app-history-back-forward-cross-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-back-forward-cross-doc.html @@ -5,16 +5,16 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-back-forward-same-doc.html b/app-history/currentchange-event/currentchange-app-history-back-forward-same-doc.html index 8cfe2dca1ffa49..41cc4afd446e63 100644 --- a/app-history/currentchange-event/currentchange-app-history-back-forward-same-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-back-forward-same-doc.html @@ -6,35 +6,35 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - await appHistory.navigate("#foo").committed; - assert_equals(appHistory.entries().length, 2); + await navigation.navigate("#foo").committed; + assert_equals(navigation.entries().length, 2); - let oncurrentchange_back_called = false; + let oncurrententrychange_back_called = false; let back_committed = false; - appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_back_called = true; - assert_equals(e.from, appHistory.entries()[1]); + navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_back_called = true; + assert_equals(e.from, navigation.entries()[1]); assert_equals(e.navigationType, "traverse"); - assert_equals(appHistory.current.index, 0); + assert_equals(navigation.currentEntry.index, 0); assert_false(back_committed); }); - let back_result = appHistory.back(); - assert_false(oncurrentchange_back_called); + let back_result = navigation.back(); + assert_false(oncurrententrychange_back_called); await back_result.committed.then(() => back_committed = true); - assert_true(oncurrentchange_back_called); + assert_true(oncurrententrychange_back_called); - let oncurrentchange_forward_called = false; + let oncurrententrychange_forward_called = false; let forward_committed = false; - appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_forward_called = true; - assert_equals(e.from, appHistory.entries()[0]); + navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_forward_called = true; + assert_equals(e.from, navigation.entries()[0]); assert_equals(e.navigationType, "traverse"); - assert_equals(appHistory.current.index, 1); + assert_equals(navigation.currentEntry.index, 1); assert_false(forward_committed); }); - let forward_result = appHistory.forward(); - assert_false(oncurrentchange_forward_called); + let forward_result = navigation.forward(); + assert_false(oncurrententrychange_forward_called); await forward_result.committed.then(() => forward_committed = true); - assert_true(oncurrentchange_forward_called); -}, "AppHistoryCurrentChangeEvent fires for appHistory.back() and appHistory.forward()"); + assert_true(oncurrententrychange_forward_called); +}, "AppHistoryCurrentChangeEvent fires for navigation.back() and navigation.forward()"); diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-cross-doc.html b/app-history/currentchange-event/currentchange-app-history-navigate-cross-doc.html index d6a657a1b1174c..2f804a307f6cbe 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-cross-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-cross-doc.html @@ -5,8 +5,8 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-preventDefault.html b/app-history/currentchange-event/currentchange-app-history-navigate-preventDefault.html index 82f10006832e16..997fb559492c73 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-preventDefault.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-preventDefault.html @@ -3,8 +3,8 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-replace-cross-doc.html b/app-history/currentchange-event/currentchange-app-history-navigate-replace-cross-doc.html index 3d8ceb746b80da..52478f22799b05 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-replace-cross-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-replace-cross-doc.html @@ -5,8 +5,8 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-replace-same-doc.html b/app-history/currentchange-event/currentchange-app-history-navigate-replace-same-doc.html index fa7006b4ebb8b0..a4027709687949 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-replace-same-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-replace-same-doc.html @@ -7,17 +7,17 @@ // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - let oncurrentchange_called = false; - let original_entry = appHistory.current; - appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; + let oncurrententrychange_called = false; + let original_entry = navigation.currentEntry; + navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; assert_equals(e.from, original_entry); assert_equals(e.from.index, -1); assert_equals(e.navigationType, "replace"); - assert_equals(appHistory.current.index, 0); + assert_equals(navigation.currentEntry.index, 0); }); - let result = appHistory.navigate("#foo", { replace: true }); - assert_true(oncurrentchange_called); + let result = navigation.navigate("#foo", { replace: true }); + assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for appHistory.navigate() with replace"); +}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() with replace"); diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-replace-transitionWhile.html b/app-history/currentchange-event/currentchange-app-history-navigate-replace-transitionWhile.html index 86079e777cb905..55b314a554d254 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-replace-transitionWhile.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-replace-transitionWhile.html @@ -6,18 +6,18 @@ promise_test(async t => { await new Promise(resolve => window.onload = resolve); - let oncurrentchange_called = false; - let original_entry = i.contentWindow.appHistory.current; - i.contentWindow.appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; + let oncurrententrychange_called = false; + let original_entry = i.contentWindow.navigation.currentEntry; + i.contentWindow.navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; assert_equals(e.from, original_entry); assert_equals(e.from.index, -1); assert_equals(e.navigationType, "replace"); - assert_equals(i.contentWindow.appHistory.current.index, 0); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); }); - i.contentWindow.appHistory.onnavigate = e => e.transitionWhile(Promise.resolve()); - let result = i.contentWindow.appHistory.navigate("/common/blank.html?1", { replace: true }); - assert_true(oncurrentchange_called); + i.contentWindow.navigation.onnavigate = e => e.transitionWhile(Promise.resolve()); + let result = i.contentWindow.navigation.navigate("/common/blank.html?1", { replace: true }); + assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for appHistory.navigate() with replace intercepted by transitionWhile"); +}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() with replace intercepted by transitionWhile"); diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-same-doc.html b/app-history/currentchange-event/currentchange-app-history-navigate-same-doc.html index d74048a0121fbc..96de3de6d3d62b 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-same-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-same-doc.html @@ -7,15 +7,15 @@ // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - let oncurrentchange_called = false; - appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; - assert_equals(e.from, appHistory.entries()[0]); + let oncurrententrychange_called = false; + navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; + assert_equals(e.from, navigation.entries()[0]); assert_equals(e.navigationType, "push"); - assert_equals(appHistory.current.index, 1); + assert_equals(navigation.currentEntry.index, 1); }); - let result = appHistory.navigate("#foo"); - assert_true(oncurrentchange_called); + let result = navigation.navigate("#foo"); + assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for appHistory.navigate()"); +}, "AppHistoryCurrentChangeEvent fires for navigation.navigate()"); diff --git a/app-history/currentchange-event/currentchange-app-history-navigate-transitionWhile.html b/app-history/currentchange-event/currentchange-app-history-navigate-transitionWhile.html index d6a39d204ed72c..2132016404dd17 100644 --- a/app-history/currentchange-event/currentchange-app-history-navigate-transitionWhile.html +++ b/app-history/currentchange-event/currentchange-app-history-navigate-transitionWhile.html @@ -6,16 +6,16 @@ promise_test(async t => { await new Promise(resolve => window.onload = resolve); - let oncurrentchange_called = false; - i.contentWindow.appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; - assert_equals(e.from, i.contentWindow.appHistory.entries()[0]); + let oncurrententrychange_called = false; + i.contentWindow.navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; + assert_equals(e.from, i.contentWindow.navigation.entries()[0]); assert_equals(e.navigationType, "push"); - assert_equals(i.contentWindow.appHistory.current.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); }); - i.contentWindow.appHistory.onnavigate = e => e.transitionWhile(Promise.resolve()); - let result = i.contentWindow.appHistory.navigate("/common/blank.html?1"); - assert_true(oncurrentchange_called); + i.contentWindow.navigation.onnavigate = e => e.transitionWhile(Promise.resolve()); + let result = i.contentWindow.navigation.navigate("/common/blank.html?1"); + assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for appHistory.navigate() intercepted by transitionWhile"); +}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() intercepted by transitionWhile"); diff --git a/app-history/currentchange-event/currentchange-app-history-reload-cross-doc.html b/app-history/currentchange-event/currentchange-app-history-reload-cross-doc.html index ae142fb5d3bc4d..cb4279cfe53f44 100644 --- a/app-history/currentchange-event/currentchange-app-history-reload-cross-doc.html +++ b/app-history/currentchange-event/currentchange-app-history-reload-cross-doc.html @@ -5,8 +5,8 @@ diff --git a/app-history/currentchange-event/currentchange-app-history-reload-transitionWhile.html b/app-history/currentchange-event/currentchange-app-history-reload-transitionWhile.html index d1f022f584218f..cfa6258dc578de 100644 --- a/app-history/currentchange-event/currentchange-app-history-reload-transitionWhile.html +++ b/app-history/currentchange-event/currentchange-app-history-reload-transitionWhile.html @@ -6,16 +6,16 @@ promise_test(async t => { await new Promise(resolve => window.onload = resolve); - let oncurrentchange_called = false; - i.contentWindow.appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; - assert_equals(e.from, i.contentWindow.appHistory.current); + let oncurrententrychange_called = false; + i.contentWindow.navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; + assert_equals(e.from, i.contentWindow.navigation.currentEntry); assert_equals(e.navigationType, "reload"); - assert_equals(i.contentWindow.appHistory.current.index, 0); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); }); - i.contentWindow.appHistory.onnavigate = e => e.transitionWhile(Promise.resolve()); - let result = i.contentWindow.appHistory.reload(); - assert_true(oncurrentchange_called); + i.contentWindow.navigation.onnavigate = e => e.transitionWhile(Promise.resolve()); + let result = i.contentWindow.navigation.reload(); + assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for appHistory.reload() intercepted by transitionWhile"); +}, "AppHistoryCurrentChangeEvent fires for navigation.reload() intercepted by transitionWhile"); diff --git a/app-history/currentchange-event/currentchange-app-history-updateCurrent.html b/app-history/currentchange-event/currentchange-app-history-updateCurrent.html index 9e3a3ec387a2ce..8d548706be938d 100644 --- a/app-history/currentchange-event/currentchange-app-history-updateCurrent.html +++ b/app-history/currentchange-event/currentchange-app-history-updateCurrent.html @@ -3,18 +3,18 @@ diff --git a/app-history/currentchange-event/currentchange-history-back-same-doc.html b/app-history/currentchange-event/currentchange-history-back-same-doc.html index a90ee1eb5ddf86..bee3649395a8b1 100644 --- a/app-history/currentchange-event/currentchange-history-back-same-doc.html +++ b/app-history/currentchange-event/currentchange-history-back-same-doc.html @@ -6,19 +6,19 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - await appHistory.navigate("#foo"); - assert_equals(appHistory.entries().length, 2); + await navigation.navigate("#foo"); + assert_equals(navigation.entries().length, 2); - let oncurrentchange_called = false; - appHistory.oncurrentchange = t.step_func(e => { - oncurrentchange_called = true; - assert_equals(e.from, appHistory.entries()[1]); + let oncurrententrychange_called = false; + navigation.oncurrententrychange = t.step_func(e => { + oncurrententrychange_called = true; + assert_equals(e.from, navigation.entries()[1]); assert_equals(e.navigationType, "traverse"); - assert_equals(appHistory.current.index, 0); + assert_equals(navigation.currentEntry.index, 0); }); history.back(); - assert_false(oncurrentchange_called); + assert_false(oncurrententrychange_called); await new Promise(resolve => window.onpopstate = resolve); - assert_true(oncurrentchange_called); + assert_true(oncurrententrychange_called); }, "AppHistoryCurrentChangeEvent fires for history.back()"); diff --git a/app-history/currentchange-event/currentchange-history-pushState.html b/app-history/currentchange-event/currentchange-history-pushState.html index e5468eafc3938f..c0e2d9a783cbe5 100644 --- a/app-history/currentchange-event/currentchange-history-pushState.html +++ b/app-history/currentchange-event/currentchange-history-pushState.html @@ -3,14 +3,14 @@ diff --git a/app-history/currentchange-event/currentchange-history-replaceState.html b/app-history/currentchange-event/currentchange-history-replaceState.html index 5a99561ebd2f92..da5505a6c14a24 100644 --- a/app-history/currentchange-event/currentchange-history-replaceState.html +++ b/app-history/currentchange-event/currentchange-history-replaceState.html @@ -3,16 +3,16 @@ diff --git a/app-history/currentchange-event/currentchange-location-api.html b/app-history/currentchange-event/currentchange-location-api.html index 8cf52ca6d28838..f06dc8ec615942 100644 --- a/app-history/currentchange-event/currentchange-location-api.html +++ b/app-history/currentchange-event/currentchange-location-api.html @@ -3,16 +3,16 @@ diff --git a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc-popup.html b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc-popup.html index 8473e0b272db09..a8aa2a25fb51c0 100644 --- a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc-popup.html +++ b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc-popup.html @@ -4,7 +4,7 @@ diff --git a/app-history/currentchange-event/currentchange-properties.html b/app-history/currentchange-event/currentchange-properties.html index a5417fa312c1b4..7048034e4f051b 100644 --- a/app-history/currentchange-event/currentchange-properties.html +++ b/app-history/currentchange-event/currentchange-properties.html @@ -3,7 +3,7 @@ diff --git a/app-history/focus-reset/autofocus.html b/app-history/focus-reset/autofocus.html index 57fdf865ab40d7..9bd4ea3e9088bb 100644 --- a/app-history/focus-reset/autofocus.html +++ b/app-history/focus-reset/autofocus.html @@ -22,11 +22,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the non-autofocused button during the transition"); @@ -43,11 +43,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the initially-focused button during the transition"); @@ -64,11 +64,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the non-autofocused button during the transition"); @@ -87,11 +87,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the non-autofocused button during the transition"); @@ -110,11 +110,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the initially-focused button during the transition"); @@ -133,11 +133,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the non-autofocused button during the transition"); @@ -155,11 +155,11 @@ decoy.focus(); assert_equals(document.activeElement, decoy, "focus() worked"); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - const { committed, finished } = appHistory.navigate("#1"); + const { committed, finished } = navigation.navigate("#1"); await committed; assert_equals(document.activeElement, decoy, "Focus stays on the non-autofocused button during the transition"); diff --git a/app-history/focus-reset/basic.html b/app-history/focus-reset/basic.html index fb57cf864482a1..8a62d88ba65983 100644 --- a/app-history/focus-reset/basic.html +++ b/app-history/focus-reset/basic.html @@ -8,14 +8,14 @@ test(() => { let throwAssertionHappened = false; - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { assert_throws_js(TypeError, () => { e.transitionWhile(Promise.resolve(), { focusReset: "invalid" }); }); throwAssertionHappened = true; }, { once: true }); - appHistory.navigate("#1"); + navigation.navigate("#1"); assert_true(throwAssertionHappened); }, "Invalid values for focusReset throw"); @@ -24,31 +24,31 @@ }, "Does not reset the focus when no navigate handler is present"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); }, "Resets the focus when no focusReset option is provided"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); }, "Resets the focus when focusReset is explicitly set to undefined"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(new Promise(r => t.step_timeout(r, 5))); }, { once: true }); }, "Resets the focus when no focusReset option is provided (nontrivial fulfilled promise)"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.reject()); }, { once: true }); }, "Resets the focus when no focusReset option is provided (rejected promise)"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile( Promise.resolve(), { focusReset: "after-transition" } @@ -57,7 +57,7 @@ }, "Resets the focus when focusReset is explicitly set to 'after-transition'"); testFocusWasNotReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "manual" }); }); }, "Does not reset the focus when focusReset is set to 'manual'"); diff --git a/app-history/focus-reset/multiple-transitionWhile.html b/app-history/focus-reset/multiple-transitionWhile.html index d38df573e59536..c1d028524a5e8c 100644 --- a/app-history/focus-reset/multiple-transitionWhile.html +++ b/app-history/focus-reset/multiple-transitionWhile.html @@ -6,61 +6,61 @@ import { testFocusWasReset, testFocusWasNotReset } from "./resources/helpers.mjs"; testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "after-transition" }); }, { once: true }); }, "(not provided) + after-transition"); testFocusWasNotReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "manual" }); }, { once: true }); }, "(not provided) + manual"); testFocusWasNotReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "after-transition" }); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "manual" }); }, { once: true }); }, "after-transition + manual"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "after-transition" }); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); }, "after-transition + (not provided)"); testFocusWasReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "manual" }); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "after-transition" }); }, { once: true }); }, "manual + after-transition"); testFocusWasNotReset(t => { - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve(), { focusReset: "manual" }); }, { once: true }); - appHistory.addEventListener("navigate", e => { + navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve()); }, { once: true }); }, "manual + (not provided)"); diff --git a/app-history/focus-reset/resources/helpers.mjs b/app-history/focus-reset/resources/helpers.mjs index e3012a0b12e618..e7e9a52009dd4c 100644 --- a/app-history/focus-reset/resources/helpers.mjs +++ b/app-history/focus-reset/resources/helpers.mjs @@ -13,7 +13,7 @@ export function testFocusWasReset(setupFunc, description) { button.focus(); assert_equals(document.activeElement, button, "focus() worked"); - const { committed, finished } = appHistory.navigate("#" + location.hash.substring(1) + "1"); + const { committed, finished } = navigation.navigate("#" + location.hash.substring(1) + "1"); await committed; assert_equals(document.activeElement, button, "Focus stays on the button during the transition"); @@ -34,7 +34,7 @@ export function testFocusWasNotReset(setupFunc, description) { button.focus(); assert_equals(document.activeElement, button, "focus() worked"); - const { committed, finished } = appHistory.navigate("#" + location.hash.substring(1) + "1"); + const { committed, finished } = navigation.navigate("#" + location.hash.substring(1) + "1"); await committed; assert_equals(document.activeElement, button, "Focus stays on the button during the transition"); diff --git a/app-history/navigate-event/cross-window/click-crossdocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/click-crossdocument-crossorigin-sameorigindomain.sub.html index 24abe7f2ef8aa5..d162d8ddb883be 100644 --- a/app-history/navigate-event/cross-window/click-crossdocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/click-crossdocument-crossorigin-sameorigindomain.sub.html @@ -19,9 +19,9 @@ link.target = iframe.name; document.body.append(link); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/click-crossdocument-crossorigin.html b/app-history/navigate-event/cross-window/click-crossdocument-crossorigin.html index 6fb559ceb12b34..2f402389126575 100644 --- a/app-history/navigate-event/cross-window/click-crossdocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/click-crossdocument-crossorigin.html @@ -24,7 +24,7 @@ assert_equals(e.data, "DONE"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => link.click()); }, "clicking on an element that navigates cross-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/click-crossdocument-sameorigin.html b/app-history/navigate-event/cross-window/click-crossdocument-sameorigin.html index ed1e8a37cda9f1..928d202045e342 100644 --- a/app-history/navigate-event/cross-window/click-crossdocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/click-crossdocument-sameorigin.html @@ -7,9 +7,9 @@ diff --git a/app-history/navigate-event/cross-window/click-samedocument-sameorigin.html b/app-history/navigate-event/cross-window/click-samedocument-sameorigin.html index a2532fc0269587..fc815abb39eb18 100644 --- a/app-history/navigate-event/cross-window/click-samedocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/click-samedocument-sameorigin.html @@ -7,7 +7,7 @@ diff --git a/app-history/navigate-event/cross-window/location-crossdocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/location-crossdocument-crossorigin-sameorigindomain.sub.html index 2623b4bbbce076..24824b12177d94 100644 --- a/app-history/navigate-event/cross-window/location-crossdocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/location-crossdocument-crossorigin-sameorigindomain.sub.html @@ -12,9 +12,9 @@ iframe.src = url; document.body.append(iframe); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/location-crossdocument-crossorigin.html b/app-history/navigate-event/cross-window/location-crossdocument-crossorigin.html index b0f031cf92478d..79df86fdc9befb 100644 --- a/app-history/navigate-event/cross-window/location-crossdocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/location-crossdocument-crossorigin.html @@ -17,7 +17,7 @@ assert_equals(e.data, "DONE"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => iframe.contentWindow.location.href = iframeURL + "?postMessage-top-when-done"); }, "using location.href to navigate cross-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/location-crossdocument-sameorigin.html b/app-history/navigate-event/cross-window/location-crossdocument-sameorigin.html index 02329697a39e73..1ac3eef874770a 100644 --- a/app-history/navigate-event/cross-window/location-crossdocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/location-crossdocument-sameorigin.html @@ -6,7 +6,7 @@ diff --git a/app-history/navigate-event/cross-window/location-samedocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/location-samedocument-crossorigin-sameorigindomain.sub.html index ec9723619f2e29..96032c14ac60a9 100644 --- a/app-history/navigate-event/cross-window/location-samedocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/location-samedocument-crossorigin-sameorigindomain.sub.html @@ -12,9 +12,9 @@ iframe.src = url; document.body.append(iframe); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/location-samedocument-crossorigin.html b/app-history/navigate-event/cross-window/location-samedocument-crossorigin.html index b5d4fbfd07af9d..8a58be7a2b4120 100644 --- a/app-history/navigate-event/cross-window/location-samedocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/location-samedocument-crossorigin.html @@ -26,7 +26,7 @@ assert_equals(e.data.destination.index, -1, "destination.index"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => iframe.contentWindow.location.href = iframeURL + "#foo"); }, "using location.href to navigate same-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/location-samedocument-sameorigin.html b/app-history/navigate-event/cross-window/location-samedocument-sameorigin.html index 634b4f77567334..3901b9ddbccc49 100644 --- a/app-history/navigate-event/cross-window/location-samedocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/location-samedocument-sameorigin.html @@ -6,7 +6,7 @@ diff --git a/app-history/navigate-event/cross-window/open-crossdocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/open-crossdocument-crossorigin-sameorigindomain.sub.html index edbcee53ef7446..d386e487a333c2 100644 --- a/app-history/navigate-event/cross-window/open-crossdocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/open-crossdocument-crossorigin-sameorigindomain.sub.html @@ -13,9 +13,9 @@ iframe.src = url; document.body.append(iframe); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/open-crossdocument-crossorigin.html b/app-history/navigate-event/cross-window/open-crossdocument-crossorigin.html index 88e975ae5dcf8b..73ede89cbf039e 100644 --- a/app-history/navigate-event/cross-window/open-crossdocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/open-crossdocument-crossorigin.html @@ -18,7 +18,7 @@ assert_equals(e.data, "DONE"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => window.open(iframeURL + "?postMessage-top-when-done", "windowname")); }, "using window.open() to navigate cross-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/open-crossdocument-sameorigin.html b/app-history/navigate-event/cross-window/open-crossdocument-sameorigin.html index 8a23dce24192db..a899dd86a3a773 100644 --- a/app-history/navigate-event/cross-window/open-crossdocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/open-crossdocument-sameorigin.html @@ -6,7 +6,7 @@ diff --git a/app-history/navigate-event/cross-window/open-samedocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/open-samedocument-crossorigin-sameorigindomain.sub.html index c072ed9d5fec43..b44303c18b8b81 100644 --- a/app-history/navigate-event/cross-window/open-samedocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/open-samedocument-crossorigin-sameorigindomain.sub.html @@ -13,9 +13,9 @@ iframe.src = url; document.body.append(iframe); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/open-samedocument-crossorigin.html b/app-history/navigate-event/cross-window/open-samedocument-crossorigin.html index e7fe633e0da5c1..65f062fcd578ba 100644 --- a/app-history/navigate-event/cross-window/open-samedocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/open-samedocument-crossorigin.html @@ -27,7 +27,7 @@ assert_equals(e.data.destination.index, -1, "destination.index"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => window.open(iframeURL + "#foo", "windowname")); }, "using window.open() to navigate same-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/open-samedocument-sameorigin.html b/app-history/navigate-event/cross-window/open-samedocument-sameorigin.html index bab81615cbefb1..3f3c38d85062d6 100644 --- a/app-history/navigate-event/cross-window/open-samedocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/open-samedocument-sameorigin.html @@ -6,7 +6,7 @@ diff --git a/app-history/navigate-event/cross-window/resources/cross-origin-iframe-helper.html b/app-history/navigate-event/cross-window/resources/cross-origin-iframe-helper.html index 48a5e1d63d9d2e..96e8a0c1e65432 100644 --- a/app-history/navigate-event/cross-window/resources/cross-origin-iframe-helper.html +++ b/app-history/navigate-event/cross-window/resources/cross-origin-iframe-helper.html @@ -1,5 +1,5 @@ diff --git a/app-history/navigate-event/cross-window/submit-crossdocument-sameorigin.html b/app-history/navigate-event/cross-window/submit-crossdocument-sameorigin.html index 45523532243b97..93b97351d752cd 100644 --- a/app-history/navigate-event/cross-window/submit-crossdocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/submit-crossdocument-sameorigin.html @@ -7,7 +7,7 @@ diff --git a/app-history/navigate-event/cross-window/submit-samedocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/submit-samedocument-crossorigin-sameorigindomain.sub.html index 4f84e6aef354bc..9f5ba8b44afc34 100644 --- a/app-history/navigate-event/cross-window/submit-samedocument-crossorigin-sameorigindomain.sub.html +++ b/app-history/navigate-event/cross-window/submit-samedocument-crossorigin-sameorigindomain.sub.html @@ -19,9 +19,9 @@ form.target = iframe.name; document.body.append(form); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => { - iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => { + iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push", "navigationType"); assert_true(e.cancelable, "cancelable"); assert_true(e.canTransition, "canTransition"); diff --git a/app-history/navigate-event/cross-window/submit-samedocument-crossorigin.html b/app-history/navigate-event/cross-window/submit-samedocument-crossorigin.html index 7e25d174713420..51a313ac18147b 100644 --- a/app-history/navigate-event/cross-window/submit-samedocument-crossorigin.html +++ b/app-history/navigate-event/cross-window/submit-samedocument-crossorigin.html @@ -33,7 +33,7 @@ assert_equals(e.data.destination.index, -1, "destination.index"); }); - appHistory.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); + navigation.onnavigate = t.unreached_func("onnavigate must not fire in the source window"); window.onload = t.step_func(() => form.submit()); }, "submitting a
element that navigates same-document targeting a cross-origin window"); diff --git a/app-history/navigate-event/cross-window/submit-samedocument-sameorigin.html b/app-history/navigate-event/cross-window/submit-samedocument-sameorigin.html index 12de577cb66bff..f0b7b7393711a3 100644 --- a/app-history/navigate-event/cross-window/submit-samedocument-sameorigin.html +++ b/app-history/navigate-event/cross-window/submit-samedocument-sameorigin.html @@ -7,7 +7,7 @@ diff --git a/app-history/navigate-event/event-constructor.html b/app-history/navigate-event/event-constructor.html index 7a8803fab41e3e..501857feba4471 100644 --- a/app-history/navigate-event/event-constructor.html +++ b/app-history/navigate-event/event-constructor.html @@ -24,7 +24,7 @@ async_test(t => { // We need to grab an AppHistoryDestination. - appHistory.onnavigate = t.step_func_done(e => { + navigation.onnavigate = t.step_func_done(e => { assert_throws_js(TypeError, () => { new AppHistoryNavigateEvent("navigate", { navigationType: "push", @@ -42,7 +42,7 @@ async_test(t => { // We need to grab an AppHistoryDestination. - appHistory.onnavigate = t.step_func_done(e => { + navigation.onnavigate = t.step_func_done(e => { const info = { some: "object with identity" }; const formData = new FormData(); const signal = (new AbortController()).signal; @@ -72,7 +72,7 @@ async_test(t => { // We need to grab an AppHistoryDestination. - appHistory.onnavigate = t.step_func_done(e => { + navigation.onnavigate = t.step_func_done(e => { const event = new AppHistoryNavigateEvent("navigate", { destination: e.destination, signal: (new AbortController()).signal diff --git a/app-history/navigate-event/navigate-anchor-cross-origin.html b/app-history/navigate-event/navigate-anchor-cross-origin.html index a6d395a35eb8b5..55ecbe749b72d9 100644 --- a/app-history/navigate-event/navigate-anchor-cross-origin.html +++ b/app-history/navigate-event/navigate-anchor-cross-origin.html @@ -4,7 +4,7 @@ diff --git a/app-history/navigate-event/navigate-appHistory-back-same-document.html b/app-history/navigate-event/navigate-appHistory-back-same-document.html index acc71ad3fe2cda..22fe9fa02ec074 100644 --- a/app-history/navigate-event/navigate-appHistory-back-same-document.html +++ b/app-history/navigate-event/navigate-appHistory-back-same-document.html @@ -6,10 +6,10 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - let target_key = appHistory.current.key; - let target_id = appHistory.current.id; - appHistory.navigate("#foo").committed.then(t.step_func(() => { - appHistory.onnavigate = t.step_func_done(e => { + let target_key = navigation.currentEntry.key; + let target_id = navigation.currentEntry.id; + navigation.navigate("#foo").committed.then(t.step_func(() => { + navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "traverse"); assert_false(e.cancelable); assert_true(e.canTransition); @@ -23,9 +23,9 @@ assert_equals(e.formData, null); assert_equals(e.info, "hi"); }); - assert_true(appHistory.canGoBack); - appHistory.back({ info: "hi" }); + assert_true(navigation.canGoBack); + navigation.back({ info: "hi" }); })); }, 0); -}, "navigate event for appHistory.back() - same-document"); +}, "navigate event for navigation.back() - same-document"); diff --git a/app-history/navigate-event/navigate-appHistory-navigate.html b/app-history/navigate-event/navigate-appHistory-navigate.html index b48e816cdff93c..5629f765f69d9e 100644 --- a/app-history/navigate-event/navigate-appHistory-navigate.html +++ b/app-history/navigate-event/navigate-appHistory-navigate.html @@ -3,7 +3,7 @@ diff --git a/app-history/navigate-event/navigate-destination-getState-back-forward.html b/app-history/navigate-event/navigate-destination-getState-back-forward.html index 07e66b8a5ffea6..8fc0f2d12810a5 100644 --- a/app-history/navigate-event/navigate-destination-getState-back-forward.html +++ b/app-history/navigate-event/navigate-destination-getState-back-forward.html @@ -7,11 +7,11 @@ // into a replace navigation. window.onload = () => t.step_timeout(t.step_func_done(() => { let navState = { statevar: "state" }; - appHistory.navigate("#foo", { replace: true, state: navState }); - let target_key = appHistory.current.key; - let target_id = appHistory.current.id; - appHistory.navigate("#bar"); - appHistory.onnavigate = t.step_func_done(e => { + navigation.navigate("#foo", { replace: true, state: navState }); + let target_key = navigation.currentEntry.key; + let target_id = navigation.currentEntry.id; + navigation.navigate("#bar"); + navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "traverse"); assert_not_equals(e.destination, null); assert_not_equals(e.destination.getState(), undefined); @@ -20,7 +20,7 @@ assert_equals(e.destination.id, null); assert_equals(e.destination.index, -1); }); - appHistory.back(); + navigation.back(); }), 0); }, "navigate event destination.getState() on back/forward navigation"); diff --git a/app-history/navigate-event/navigate-destination-getState-navigate.html b/app-history/navigate-event/navigate-destination-getState-navigate.html index 43ca7b42c47a0b..9c34c5753a1197 100644 --- a/app-history/navigate-event/navigate-destination-getState-navigate.html +++ b/app-history/navigate-event/navigate-destination-getState-navigate.html @@ -7,7 +7,7 @@ // into a replace navigation. window.onload = () => t.step_timeout(() => { let navState = { statevar: "state" }; - appHistory.onnavigate = t.step_func_done(e => { + navigation.onnavigate = t.step_func_done(e => { assert_equals(e.navigationType, "push"); assert_not_equals(e.destination, null); assert_not_equals(e.destination.getState(), undefined); @@ -17,7 +17,7 @@ assert_equals(e.destination.id, null); assert_equals(e.destination.index, -1); }); - appHistory.navigate("#foo", { state: navState }); + navigation.navigate("#foo", { state: navState }); }, 0); }, "navigate event destination.getState() should be the state given to navigate()"); diff --git a/app-history/navigate-event/navigate-form-get.html b/app-history/navigate-event/navigate-form-get.html index 843849154d1ec4..3c76accaabb3ad 100644 --- a/app-history/navigate-event/navigate-form-get.html +++ b/app-history/navigate-event/navigate-form-get.html @@ -4,7 +4,7 @@
diff --git a/app-history/navigate-event/resources/navigatesuccess-cross-document-helper.html b/app-history/navigate-event/resources/navigatesuccess-cross-document-helper.html index c073184b9b343e..aabc5015a963f6 100644 --- a/app-history/navigate-event/resources/navigatesuccess-cross-document-helper.html +++ b/app-history/navigate-event/resources/navigatesuccess-cross-document-helper.html @@ -1,6 +1,6 @@ diff --git a/app-history/navigate-event/signal-abort-detach-in-onnavigate.html b/app-history/navigate-event/signal-abort-detach-in-onnavigate.html index 19ab7ae414b615..adef895565b9bc 100644 --- a/app-history/navigate-event/signal-abort-detach-in-onnavigate.html +++ b/app-history/navigate-event/signal-abort-detach-in-onnavigate.html @@ -9,12 +9,12 @@ let iframe_typeerror = i.contentWindow.TypeError; let abort_signal; let onabort_called = false; - i.contentWindow.appHistory.onnavigate = t.step_func(e => { + i.contentWindow.navigation.onnavigate = t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => onabort_called = true; i.remove(); }); - await promise_rejects_dom(t, 'AbortError', iframe_constructor, i.contentWindow.appHistory.navigate("#1").committed); + await promise_rejects_dom(t, 'AbortError', iframe_constructor, i.contentWindow.navigation.navigate("#1").committed); assert_true(abort_signal.aborted); assert_true(onabort_called); }, "window detach inside AppHistoryNavigateEvent signals AppHistoryNavigateEvent.signal"); diff --git a/app-history/navigate-event/signal-abort-preventDefault.html b/app-history/navigate-event/signal-abort-preventDefault.html index f9a1cd7015de03..f281617866c0cd 100644 --- a/app-history/navigate-event/signal-abort-preventDefault.html +++ b/app-history/navigate-event/signal-abort-preventDefault.html @@ -5,14 +5,14 @@ promise_test(async t => { let abort_signal; let events = []; - appHistory.onnavigateerror = () => events.push("onnavigateerror"); - appHistory.onnavigate = t.step_func(e => { + navigation.onnavigateerror = () => events.push("onnavigateerror"); + navigation.onnavigate = t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => events.push("onabort"); e.preventDefault(); }); - await promise_rejects_dom(t, 'AbortError', appHistory.navigate("?1").committed); + await promise_rejects_dom(t, 'AbortError', navigation.navigate("?1").committed); assert_true(abort_signal.aborted); assert_array_equals(events, ["onabort", "onnavigateerror"]); }, "AppHistoryNavigateEvent.preventDefault signals AppHistoryNavigateEvent.signal"); diff --git a/app-history/navigate-event/signal-abort-transitionWhile.html b/app-history/navigate-event/signal-abort-transitionWhile.html index 82d0c07eb74e4e..d90ee5b0837c41 100644 --- a/app-history/navigate-event/signal-abort-transitionWhile.html +++ b/app-history/navigate-event/signal-abort-transitionWhile.html @@ -5,13 +5,13 @@ promise_test(async t => { let abort_signal; let onabort_called = false; - appHistory.onnavigate = t.step_func(e => { + navigation.onnavigate = t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => onabort_called = true; e.transitionWhile(Promise.resolve()); }); - await appHistory.navigate("?1").finished; + await navigation.navigate("?1").finished; assert_false(abort_signal.aborted); assert_false(onabort_called); }, "AppHistoryNavigateEvent's transitionWhile() does not signal AppHistoryNavigateEvent's signal"); diff --git a/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html b/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html index 108ef39ffee813..aad3be34d7e80b 100644 --- a/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html +++ b/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html @@ -8,20 +8,20 @@ let abort_signal; let onabort_called = false; let navigateErrorException; - appHistory.onnavigateerror = t.step_func(e => { + navigation.onnavigateerror = t.step_func(e => { assert_equals(e.constructor, ErrorEvent); navigateErrorException = e.error; assert_equals(e.filename, start_url); assert_greater_than(e.lineno, 0); assert_greater_than(e.colno, 0); }); - appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess"); - appHistory.onnavigate = t.step_func(e => { + navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess"); + navigation.onnavigate = t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => onabort_called = true; e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 0))); }); - let result = appHistory.navigate("?1"); + let result = navigation.navigate("?1"); window.stop(); assert_true(abort_signal.aborted); assert_true(onabort_called); diff --git a/app-history/navigate-event/signal-abort-window-stop-in-onnavigate.html b/app-history/navigate-event/signal-abort-window-stop-in-onnavigate.html index 00be9925ea9b13..dde666c9338617 100644 --- a/app-history/navigate-event/signal-abort-window-stop-in-onnavigate.html +++ b/app-history/navigate-event/signal-abort-window-stop-in-onnavigate.html @@ -7,15 +7,15 @@ let abort_signal; let onabort_called = false; let canceled_in_second_handler = false; - appHistory.addEventListener("navigate", t.step_func(e => { + navigation.addEventListener("navigate", t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => onabort_called = true; window.stop(); })); - appHistory.addEventListener("navigate", t.step_func(e => { + navigation.addEventListener("navigate", t.step_func(e => { canceled_in_second_handler = e.defaultPrevented; })); - appHistory.navigate("?1"); + navigation.navigate("?1"); assert_true(abort_signal.aborted); assert_true(onabort_called); assert_true(canceled_in_second_handler); diff --git a/app-history/navigate-event/signal-abort-window-stop.html b/app-history/navigate-event/signal-abort-window-stop.html index 03c36f7f6d683a..49399fb663777e 100644 --- a/app-history/navigate-event/signal-abort-window-stop.html +++ b/app-history/navigate-event/signal-abort-window-stop.html @@ -6,12 +6,12 @@ window.onload = t.step_func(() => { let abort_signal; let onabort_called = false; - appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess"); - appHistory.onnavigate = t.step_func(e => { + navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess"); + navigation.onnavigate = t.step_func(e => { abort_signal = e.signal; abort_signal.onabort = () => onabort_called = true; }); - appHistory.navigate("?1"); + navigation.navigate("?1"); window.stop(); assert_true(abort_signal.aborted); assert_true(onabort_called); diff --git a/app-history/navigate-event/transitionWhile-after-dispatch.html b/app-history/navigate-event/transitionWhile-after-dispatch.html index f4cc707a48dabd..7f4a25cef528a1 100644 --- a/app-history/navigate-event/transitionWhile-after-dispatch.html +++ b/app-history/navigate-event/transitionWhile-after-dispatch.html @@ -4,7 +4,7 @@ diff --git a/app-history/navigate-event/transitionWhile-appHistory-back.html b/app-history/navigate-event/transitionWhile-appHistory-back.html index c05e7d3bc63c3f..a0bc453d36e309 100644 --- a/app-history/navigate-event/transitionWhile-appHistory-back.html +++ b/app-history/navigate-event/transitionWhile-appHistory-back.html @@ -6,14 +6,14 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - appHistory.navigate("#foo").committed.then(() => { - assert_true(appHistory.canGoBack); - appHistory.onnavigate = t.step_func(e => e.transitionWhile(Promise.resolve())); - appHistory.back().committed.then(t.step_func_done(() => { - assert_equals(appHistory.entries().length, 2); - assert_equals(appHistory.current, appHistory.entries()[0]); + navigation.navigate("#foo").committed.then(() => { + assert_true(navigation.canGoBack); + navigation.onnavigate = t.step_func(e => e.transitionWhile(Promise.resolve())); + navigation.back().committed.then(t.step_func_done(() => { + assert_equals(navigation.entries().length, 2); + assert_equals(navigation.currentEntry, navigation.entries()[0]); })); }); }, 0); -}, "AppHistoryNavigateEvent's transitionWhile() can intercept appHistory.back()"); +}, "AppHistoryNavigateEvent's transitionWhile() can intercept navigation.back()"); diff --git a/app-history/navigate-event/transitionWhile-canceled-event.html b/app-history/navigate-event/transitionWhile-canceled-event.html index 79ed0571a450c6..ed6dbdc85cfe07 100644 --- a/app-history/navigate-event/transitionWhile-canceled-event.html +++ b/app-history/navigate-event/transitionWhile-canceled-event.html @@ -5,7 +5,7 @@ diff --git a/app-history/navigate-event/transitionWhile-on-synthetic-event.html b/app-history/navigate-event/transitionWhile-on-synthetic-event.html index a3bb80fe66ccf1..21a32e7b4c9394 100644 --- a/app-history/navigate-event/transitionWhile-on-synthetic-event.html +++ b/app-history/navigate-event/transitionWhile-on-synthetic-event.html @@ -4,7 +4,7 @@ diff --git a/app-history/navigate/disambigaute-back.html b/app-history/navigate/disambigaute-back.html index 7a4a37db4216fb..d44d435896dd87 100644 --- a/app-history/navigate/disambigaute-back.html +++ b/app-history/navigate/disambigaute-back.html @@ -7,26 +7,26 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - assert_equals(appHistory.entries().length, 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - appHistory.navigate("#top"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - i.contentWindow.appHistory.navigate("#1"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 1); - assert_true(appHistory.canGoBack); - assert_true(i.contentWindow.appHistory.canGoBack); + assert_equals(navigation.entries().length, 1); + assert_equals(i.contentWindow.navigation.entries().length, 1); + navigation.navigate("#top"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 1); + i.contentWindow.navigation.navigate("#1"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); + assert_true(navigation.canGoBack); + assert_true(i.contentWindow.navigation.canGoBack); // There are 2 joint session history entries containing the iframe's // previous key. Navigate to the nearest one (which navigates the iframe // but not the top window). - i.contentWindow.appHistory.back().committed.then(t.step_func_done(() => { - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 0); + i.contentWindow.navigation.back().committed.then(t.step_func_done(() => { + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); })); }, 0); -}, "appHistory.back() goes to the nearest back entry"); +}, "navigation.back() goes to the nearest back entry"); diff --git a/app-history/navigate/disambigaute-forward.html b/app-history/navigate/disambigaute-forward.html index b6508ed3406b6d..e252e309941037 100644 --- a/app-history/navigate/disambigaute-forward.html +++ b/app-history/navigate/disambigaute-forward.html @@ -7,34 +7,34 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - assert_equals(appHistory.entries().length, 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - appHistory.navigate("#top"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - i.contentWindow.appHistory.navigate("#1"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 1); - assert_true(appHistory.canGoBack); - assert_true(i.contentWindow.appHistory.canGoBack); + assert_equals(navigation.entries().length, 1); + assert_equals(i.contentWindow.navigation.entries().length, 1); + navigation.navigate("#top"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 1); + i.contentWindow.navigation.navigate("#1"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); + assert_true(navigation.canGoBack); + assert_true(i.contentWindow.navigation.canGoBack); - i.contentWindow.appHistory.back().committed.then(t.step_func(() => { - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 0); - appHistory.back().committed.then(t.step_func(() => { - assert_equals(appHistory.current.index, 0); - assert_equals(i.contentWindow.appHistory.current.index, 0); + i.contentWindow.navigation.back().committed.then(t.step_func(() => { + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); + navigation.back().committed.then(t.step_func(() => { + assert_equals(navigation.currentEntry.index, 0); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); // There are 2 joint session history entries containing the top window's // final key. Navigate to the nearest one (which navigates only the // top window). - appHistory.forward().committed.then(t.step_func_done(() => { - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 0); + navigation.forward().committed.then(t.step_func_done(() => { + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); })); })); })); }, 0); -}, "appHistory.forward() goes to the nearest forward entry"); +}, "navigation.forward() goes to the nearest forward entry"); diff --git a/app-history/navigate/disambigaute-goto-back-multiple.html b/app-history/navigate/disambigaute-goto-back-multiple.html index c39da7914f12a8..03a8eb10edeb85 100644 --- a/app-history/navigate/disambigaute-goto-back-multiple.html +++ b/app-history/navigate/disambigaute-goto-back-multiple.html @@ -7,29 +7,29 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - assert_equals(appHistory.entries().length, 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - appHistory.navigate("#top"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 1); + assert_equals(navigation.entries().length, 1); + assert_equals(i.contentWindow.navigation.entries().length, 1); + navigation.navigate("#top"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 1); - let iframe_initial_key = i.contentWindow.appHistory.current.key; - i.contentWindow.appHistory.navigate("#1"); - i.contentWindow.appHistory.navigate("#2"); - assert_equals(appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.entries().length, 3); - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 2); - assert_true(appHistory.canGoBack); - assert_true(i.contentWindow.appHistory.canGoBack); + let iframe_initial_key = i.contentWindow.navigation.currentEntry.key; + i.contentWindow.navigation.navigate("#1"); + i.contentWindow.navigation.navigate("#2"); + assert_equals(navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.entries().length, 3); + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 2); + assert_true(navigation.canGoBack); + assert_true(i.contentWindow.navigation.canGoBack); // There are 2 joint session history entries containing the iframe's // initial key. Navigate to the nearest one (which navigates the iframe // but not the top window). - i.contentWindow.appHistory.goTo(iframe_initial_key).committed.then(t.step_func_done(() => { - assert_equals(appHistory.current.index, 1); - assert_equals(i.contentWindow.appHistory.current.index, 0); + i.contentWindow.navigation.traverseTo(iframe_initial_key).committed.then(t.step_func_done(() => { + assert_equals(navigation.currentEntry.index, 1); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); })); }, 0); -}, "appHistory.goTo() goes to the nearest entry when going back"); +}, "navigation.traverseTo() goes to the nearest entry when going back"); diff --git a/app-history/navigate/disambigaute-goto-forward-multiple.html b/app-history/navigate/disambigaute-goto-forward-multiple.html index 08c00582d8fd34..f8e78c4b1d951d 100644 --- a/app-history/navigate/disambigaute-goto-forward-multiple.html +++ b/app-history/navigate/disambigaute-goto-forward-multiple.html @@ -7,33 +7,33 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - assert_equals(appHistory.entries().length, 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - let initial_key = appHistory.current.key; - await appHistory.navigate("#top1").committed; - await appHistory.navigate("#top2").committed; - assert_equals(appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - await i.contentWindow.appHistory.navigate("#1").committed; - assert_equals(appHistory.entries().length, 3); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(appHistory.current.index, 2); - assert_equals(i.contentWindow.appHistory.current.index, 1); - assert_true(appHistory.canGoBack); - assert_true(i.contentWindow.appHistory.canGoBack); - let final_key = appHistory.current.key; + assert_equals(navigation.entries().length, 1); + assert_equals(i.contentWindow.navigation.entries().length, 1); + let initial_key = navigation.currentEntry.key; + await navigation.navigate("#top1").committed; + await navigation.navigate("#top2").committed; + assert_equals(navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.entries().length, 1); + await i.contentWindow.navigation.navigate("#1").committed; + assert_equals(navigation.entries().length, 3); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(navigation.currentEntry.index, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); + assert_true(navigation.canGoBack); + assert_true(i.contentWindow.navigation.canGoBack); + let final_key = navigation.currentEntry.key; - await i.contentWindow.appHistory.back().committed; - assert_equals(appHistory.current.index, 2); - assert_equals(i.contentWindow.appHistory.current.index, 0); - await appHistory.goTo(initial_key).committed; - assert_equals(appHistory.current.index, 0); - assert_equals(i.contentWindow.appHistory.current.index, 0); + await i.contentWindow.navigation.back().committed; + assert_equals(navigation.currentEntry.index, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); + await navigation.traverseTo(initial_key).committed; + assert_equals(navigation.currentEntry.index, 0); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); // There are 2 joint session history entries containing the top window's // final key. Navigate to the nearest one (which navigates only the // top window). - await appHistory.goTo(final_key).committed; - assert_equals(appHistory.current.index, 2); - assert_equals(i.contentWindow.appHistory.current.index, 0); -}, "appHistory.goTo() goes to the nearest entry when going forward"); + await navigation.traverseTo(final_key).committed; + assert_equals(navigation.currentEntry.index, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); +}, "navigation.traverseTo() goes to the nearest entry when going forward"); diff --git a/app-history/navigate/forward-to-pruned-entry.html b/app-history/navigate/forward-to-pruned-entry.html index 0e33360c8674f9..b8bd36ef061e89 100644 --- a/app-history/navigate/forward-to-pruned-entry.html +++ b/app-history/navigate/forward-to-pruned-entry.html @@ -6,26 +6,26 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - await appHistory.navigate("#foo").finished; - assert_equals(appHistory.entries().length, 2); - await appHistory.back().finished; - assert_equals(appHistory.current.index, 0); + await navigation.navigate("#foo").finished; + assert_equals(navigation.entries().length, 2); + await navigation.back().finished; + assert_equals(navigation.currentEntry.index, 0); // Traverse forward then immediately do a same-document push. This will // truncate the back forward list, and by the time the traverse commits, the - // destination key will no longer be present in appHistory.entries(). The + // destination key will no longer be present in navigation.entries(). The // traverse should abort. - let forward_value = appHistory.forward(); - await appHistory.navigate("#clobber").finished; - assert_equals(appHistory.current.index, 1); + let forward_value = navigation.forward(); + await navigation.navigate("#clobber").finished; + assert_equals(navigation.currentEntry.index, 1); await promise_rejects_dom(t, "AbortError", forward_value.committed); await promise_rejects_dom(t, "AbortError", forward_value.finished); - // This leaves appHistory.entries() in a consistent state where traversing + // This leaves navigation.entries() in a consistent state where traversing // back and forward still works. - await appHistory.back().finished; - assert_equals(appHistory.current.index, 0); - await appHistory.forward().finished; - assert_equals(appHistory.current.index, 1); + await navigation.back().finished; + assert_equals(navigation.currentEntry.index, 0); + await navigation.forward().finished; + assert_equals(navigation.currentEntry.index, 1); }, "If forward pruning clobbers the target of a traverse, abort"); diff --git a/app-history/navigate/goTo-after-adding-iframe.html b/app-history/navigate/goTo-after-adding-iframe.html index 9921bcf447fb6e..5ab28205510800 100644 --- a/app-history/navigate/goTo-after-adding-iframe.html +++ b/app-history/navigate/goTo-after-adding-iframe.html @@ -9,26 +9,26 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - appHistory.navigate("#top"); - assert_equals(appHistory.entries().length, 2); + navigation.navigate("#top"); + assert_equals(navigation.entries().length, 2); let i = document.createElement("iframe"); i.src = "/common/blank.html"; document.body.appendChild(i); i.onload = () => t.step_timeout(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 1); - i.contentWindow.appHistory.navigate("#fragment"); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - i.contentWindow.appHistory.back().committed.then(t.step_func(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 0); - return i.contentWindow.appHistory.forward().committed; + assert_equals(i.contentWindow.navigation.entries().length, 1); + i.contentWindow.navigation.navigate("#fragment"); + assert_equals(i.contentWindow.navigation.entries().length, 2); + i.contentWindow.navigation.back().committed.then(t.step_func(() => { + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); + return i.contentWindow.navigation.forward().committed; })).then(t.step_func_done(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 1); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); })); }, 0); }, 0); -}, "appHistory.goTo() should work in an iframe that is not present in all history entries"); +}, "navigation.traverseTo() should work in an iframe that is not present in all history entries"); diff --git a/app-history/navigate/goTo-after-data-url.html b/app-history/navigate/goTo-after-data-url.html index ba2b56d1912abd..0b21a741d3017b 100644 --- a/app-history/navigate/goTo-after-data-url.html +++ b/app-history/navigate/goTo-after-data-url.html @@ -15,19 +15,19 @@ i.contentWindow.location = "/common/blank.html"; i.onload = () => t.step_timeout(() => { assert_equals(history.length, start_length + 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - i.contentWindow.appHistory.navigate("#fragment"); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - i.contentWindow.appHistory.back().committed.then(t.step_func(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 0); - return i.contentWindow.appHistory.forward().committed; + assert_equals(i.contentWindow.navigation.entries().length, 1); + i.contentWindow.navigation.navigate("#fragment"); + assert_equals(i.contentWindow.navigation.entries().length, 2); + i.contentWindow.navigation.back().committed.then(t.step_func(() => { + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); + return i.contentWindow.navigation.forward().committed; })).then(t.step_func_done(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 1); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); })); }, 0); }, 0); -}, "appHistory.goTo() should work in an iframe that started at a data: url"); +}, "navigation.traverseTo() should work in an iframe that started at a data: url"); diff --git a/app-history/navigate/goTo-cross-document.html b/app-history/navigate/goTo-cross-document.html index 0a7bbbe1bf97ac..2540639baddd6c 100644 --- a/app-history/navigate/goTo-cross-document.html +++ b/app-history/navigate/goTo-cross-document.html @@ -7,35 +7,35 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 1); + assert_equals(i.contentWindow.navigation.entries().length, 1); let next_step = "goto"; - let key = i.contentWindow.appHistory.current.key; - i.contentWindow.appHistory.navigate("?1"); + let key = i.contentWindow.navigation.currentEntry.key; + i.contentWindow.navigation.navigate("?1"); i.onload = t.step_func(() => { if (next_step == "goto") { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]); - i.contentWindow.appHistory.goTo(key); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]); + i.contentWindow.navigation.traverseTo(key); next_step = "forward"; } else if (next_step == "forward") { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(key, i.contentWindow.appHistory.current.key); - assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[0]); - assert_true(i.contentWindow.appHistory.canGoForward); - i.contentWindow.appHistory.forward(); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(key, i.contentWindow.navigation.currentEntry.key); + assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[0]); + assert_true(i.contentWindow.navigation.canGoForward); + i.contentWindow.navigation.forward(); next_step = "back"; } else if (next_step == "back") { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]); - assert_true(i.contentWindow.appHistory.canGoBack); - i.contentWindow.appHistory.back(); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]); + assert_true(i.contentWindow.navigation.canGoBack); + i.contentWindow.navigation.back(); next_step = "finish"; } else if (next_step == "finish") { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[0]); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[0]); t.done(); } }); }, 0); -}, "cross-document navigate.goTo(), back(), and forward()"); +}, "cross-document traverseTo(), back(), and forward()"); diff --git a/app-history/navigate/goTo-detach-between-navigate-and-navigatesuccess.html b/app-history/navigate/goTo-detach-between-navigate-and-navigatesuccess.html index 2849ee1e9a21d7..9a9529578147b5 100644 --- a/app-history/navigate/goTo-detach-between-navigate-and-navigatesuccess.html +++ b/app-history/navigate/goTo-detach-between-navigate-and-navigatesuccess.html @@ -12,35 +12,35 @@ const iDOMException = iWindow.DOMException; const iAppHistoryEntry = iWindow.AppHistoryEntry; - i.contentWindow.appHistory.navigate("#1").finished.then(t.step_func(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - let key = i.contentWindow.appHistory.entries()[0].key; + i.contentWindow.navigation.navigate("#1").finished.then(t.step_func(() => { + assert_equals(i.contentWindow.navigation.entries().length, 2); + let key = i.contentWindow.navigation.entries()[0].key; let onnavigateerror_called = false; let result; - i.contentWindow.appHistory.onnavigate = t.step_func(e => { + i.contentWindow.navigation.onnavigate = t.step_func(e => { e.transitionWhile(new Promise(resolve => () => t.step_timeout(resolve, 2))); t.step_timeout(() => i.remove(), 1); }); - i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire"); + i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire"); - i.contentWindow.appHistory.onnavigateerror = t.step_func(e => { + i.contentWindow.navigation.onnavigateerror = t.step_func(e => { assert_false(onnavigateerror_called); onnavigateerror_called = true; assert_equals(e.filename, location.href); assert_greater_than(e.lineno, 0); assert_greater_than(e.colno, 0); - assertCommittedFulfillsFinishedRejectsExactly(t, result, iWindow.appHistory.current, e.error, iWindow, iDOMException, iAppHistoryEntry).then( + assertCommittedFulfillsFinishedRejectsExactly(t, result, iWindow.navigation.currentEntry, e.error, iWindow, iDOMException, iAppHistoryEntry).then( () => t.done(), t.step_func(err => { throw err; }) ); }); - result = i.contentWindow.appHistory.goTo(key); + result = i.contentWindow.navigation.traverseTo(key); })); }); -}, "Detach a window between when a goTo() fires navigate and navigatesuccess"); +}, "Detach a window between when a traverseTo() fires navigate and navigatesuccess"); diff --git a/app-history/navigate/goTo-multiple-steps.html b/app-history/navigate/goTo-multiple-steps.html index 562a775d2298f6..059eb214a8b852 100644 --- a/app-history/navigate/goTo-multiple-steps.html +++ b/app-history/navigate/goTo-multiple-steps.html @@ -6,20 +6,20 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0)); - assert_equals(appHistory.entries().length, 1); - let key0 = appHistory.current.key; - await appHistory.navigate("#1").committed; - await appHistory.navigate("#2").committed; - let key2 = appHistory.current.key; - assert_equals(appHistory.entries().length, 3); + assert_equals(navigation.entries().length, 1); + let key0 = navigation.currentEntry.key; + await navigation.navigate("#1").committed; + await navigation.navigate("#2").committed; + let key2 = navigation.currentEntry.key; + assert_equals(navigation.entries().length, 3); - await appHistory.goTo(key0).committed; - assert_equals(appHistory.entries().length, 3); - assert_equals(appHistory.current, appHistory.entries()[0]); - assert_equals(key0, appHistory.current.key); - await appHistory.goTo(key2).committed; - assert_equals(appHistory.entries().length, 3); - assert_equals(appHistory.current, appHistory.entries()[2]); - assert_equals(key2, appHistory.current.key); + await navigation.traverseTo(key0).committed; + assert_equals(navigation.entries().length, 3); + assert_equals(navigation.currentEntry, navigation.entries()[0]); + assert_equals(key0, navigation.currentEntry.key); + await navigation.traverseTo(key2).committed; + assert_equals(navigation.entries().length, 3); + assert_equals(navigation.currentEntry, navigation.entries()[2]); + assert_equals(key2, navigation.currentEntry.key); }, "goto() can precisely traverse multiple steps in the joint session history"); diff --git a/app-history/navigate/goTo-same-document.html b/app-history/navigate/goTo-same-document.html index a9af0c2ae22904..1a32bce99c98e2 100644 --- a/app-history/navigate/goTo-same-document.html +++ b/app-history/navigate/goTo-same-document.html @@ -6,38 +6,38 @@ // Wait for after the load event so that the navigation doesn't get converted // into a replace navigation. window.onload = () => t.step_timeout(() => { - assert_equals(appHistory.entries().length, 1); + assert_equals(navigation.entries().length, 1); let onnavigate_count = 0; - appHistory.onnavigate = () => onnavigate_count++; + navigation.onnavigate = () => onnavigate_count++; - let key = appHistory.current.key; - appHistory.navigate("#").committed + let key = navigation.currentEntry.key; + navigation.navigate("#").committed .then(t.step_func(() => { - assert_equals(appHistory.entries().length, 2); - assert_equals(appHistory.current, appHistory.entries()[1]); - assert_not_equals(key, appHistory.current.key); - return appHistory.goTo(key).committed; + assert_equals(navigation.entries().length, 2); + assert_equals(navigation.currentEntry, navigation.entries()[1]); + assert_not_equals(key, navigation.currentEntry.key); + return navigation.traverseTo(key).committed; })) .then(t.step_func(() => { - assert_equals(appHistory.entries().length, 2); - assert_equals(appHistory.current, appHistory.entries()[0]); - assert_equals(key, appHistory.current.key); - assert_true(appHistory.canGoForward); - return appHistory.forward().committed; + assert_equals(navigation.entries().length, 2); + assert_equals(navigation.currentEntry, navigation.entries()[0]); + assert_equals(key, navigation.currentEntry.key); + assert_true(navigation.canGoForward); + return navigation.forward().committed; })) .then(t.step_func(() => { - assert_equals(appHistory.entries().length, 2); - assert_equals(appHistory.current, appHistory.entries()[1]); - assert_true(appHistory.canGoBack); - return appHistory.back().committed; + assert_equals(navigation.entries().length, 2); + assert_equals(navigation.currentEntry, navigation.entries()[1]); + assert_true(navigation.canGoBack); + return navigation.back().committed; })) .then(t.step_func_done(() => { - assert_equals(appHistory.entries().length, 2); - assert_equals(appHistory.current, appHistory.entries()[0]); - assert_equals(key, appHistory.current.key); + assert_equals(navigation.entries().length, 2); + assert_equals(navigation.currentEntry, navigation.entries()[0]); + assert_equals(key, navigation.currentEntry.key); assert_equals(onnavigate_count, 4); })); }, 0); -}, "same-document navigate.goTo(), back(), and forward()"); +}, "same-document navigate.traverseTo(), back(), and forward()"); diff --git a/app-history/navigate/goTo-with-cross-origin-in-history.html b/app-history/navigate/goTo-with-cross-origin-in-history.html index 3da29550b3e8a3..a6b7745584a645 100644 --- a/app-history/navigate/goTo-with-cross-origin-in-history.html +++ b/app-history/navigate/goTo-with-cross-origin-in-history.html @@ -19,19 +19,19 @@ i.contentWindow.location = "/common/blank.html"; i.onload = () => t.step_timeout(() => { assert_equals(history.length, start_length + 1); - assert_equals(i.contentWindow.appHistory.entries().length, 1); - i.contentWindow.appHistory.navigate("#fragment"); - assert_equals(i.contentWindow.appHistory.entries().length, 2); - i.contentWindow.appHistory.back().committed.then(t.step_func(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 0); - return i.contentWindow.appHistory.forward().committed; + assert_equals(i.contentWindow.navigation.entries().length, 1); + i.contentWindow.navigation.navigate("#fragment"); + assert_equals(i.contentWindow.navigation.entries().length, 2); + i.contentWindow.navigation.back().committed.then(t.step_func(() => { + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 0); + return i.contentWindow.navigation.forward().committed; })).then(t.step_func_done(() => { - assert_equals(i.contentWindow.appHistory.entries().length, 2); - assert_equals(i.contentWindow.appHistory.current.index, 1); + assert_equals(i.contentWindow.navigation.entries().length, 2); + assert_equals(i.contentWindow.navigation.currentEntry.index, 1); })); }, 0); }, 0); -}, "appHistory.goTo() should work in an iframe that has navigated across origins"); +}, "navigation.traverseTo() should work in an iframe that has navigated across origins"); diff --git a/app-history/navigate/navigate-base-url.html b/app-history/navigate/navigate-base-url.html index b11a71a9312785..00fefa6608f27f 100644 --- a/app-history/navigate/navigate-base-url.html +++ b/app-history/navigate/navigate-base-url.html @@ -5,11 +5,11 @@ diff --git a/app-history/navigate/navigate-from-initial-about-blank-src.html b/app-history/navigate/navigate-from-initial-about-blank-src.html index 83cd77678a544f..2044b33cf02727 100644 --- a/app-history/navigate/navigate-from-initial-about-blank-src.html +++ b/app-history/navigate/navigate-from-initial-about-blank-src.html @@ -6,7 +6,7 @@