App history API to navigation API rename (1/n) (#33132)
See https://github.com/WICG/navigation-api/issues/83 and https://github.com/WICG/navigation-api/pull/203 for context.
This CL implements the following renames:
* window.appHistory → window.navigation
* appHistory.current → navigation.currentEntry
* appHistory.updateCurrent() → navigation.updateCurrentEntry()
* appHistory currentchange event → navigation currententrychange event
* appHistory.goTo() → navigation.traverseTo()
Notably, window.navigation has to be [Replaceable], as otherwise various internal tests that do `var navigation = ...` start failing.
No files are renamed at this point (including test files). No classes/IDL interfaces are renamed either.
Thus, the majority of this renaming is done in the web platform tests corpus, and to method names of the AppHistory C++ class.
Bug: 1300246
Change-Id: I29a01c6992c06a5d5099d831273ca8041281d557
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3510372
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980648}
Co-authored-by: Domenic Denicola <domenic@chromium.org>
diff --git a/app-history/README.md b/app-history/README.md
new file mode 100644
index 0000000..068ae5b
--- /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
+<https://crbug.com/1300246>.
diff --git a/app-history/app-history-entry/after-detach.html b/app-history/app-history-entry/after-detach.html
index 07591f9..c4ecfec 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");
</script>
diff --git a/app-history/app-history-entry/current-basic.html b/app-history/app-history-entry/current-basic.html
index 102fbbb..78bbbb0 100644
--- a/app-history/app-history-entry/current-basic.html
+++ b/app-history/app-history-entry/current-basic.html
@@ -4,7 +4,7 @@
<script src="resources/is_uuid.js"></script>
<script>
test(() => {
- let first_entry = appHistory.current;
+ let first_entry = navigation.currentEntry;
assert_not_equals(first_entry, null);
assert_not_equals(first_entry.key, null);
assert_true(isUUID(first_entry.key));
@@ -12,11 +12,11 @@
assert_true(isUUID(first_entry.id));
assert_equals(first_entry.url, location.href);
assert_true(first_entry.sameDocument);
- assert_equals(appHistory.entries().length, 1);
- assert_equals(first_entry, appHistory.entries()[0]);
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(first_entry, navigation.entries()[0]);
history.replaceState(2, "", "#2");
- let second_entry = appHistory.current;
+ let second_entry = navigation.currentEntry;
assert_not_equals(second_entry, first_entry);
assert_equals(second_entry.key, first_entry.key);
assert_true(isUUID(second_entry.key));
@@ -24,11 +24,11 @@
assert_true(isUUID(second_entry.id));
assert_equals(second_entry.url, location.href);
assert_true(second_entry.sameDocument);
- assert_equals(appHistory.entries().length, 1);
- assert_equals(second_entry, appHistory.entries()[0]);
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(second_entry, navigation.entries()[0]);
history.pushState(3, "", "#3");
- let third_entry = appHistory.current;
+ let third_entry = navigation.currentEntry;
assert_not_equals(third_entry, second_entry);
assert_not_equals(third_entry.key, second_entry.key);
assert_true(isUUID(third_entry.key));
@@ -36,11 +36,11 @@
assert_true(isUUID(third_entry.id));
assert_equals(third_entry.url, location.href);
assert_true(third_entry.sameDocument);
- assert_equals(appHistory.entries().length, 2);
- assert_equals(third_entry, appHistory.entries()[1]);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(third_entry, navigation.entries()[1]);
history.pushState(4, "");
- let fourth_entry = appHistory.current;
+ let fourth_entry = navigation.currentEntry;
assert_not_equals(fourth_entry, third_entry);
assert_not_equals(fourth_entry.key, third_entry.key);
assert_true(isUUID(fourth_entry.key));
@@ -48,11 +48,11 @@
assert_true(isUUID(fourth_entry.id));
assert_equals(fourth_entry.url, third_entry.url);
assert_true(fourth_entry.sameDocument);
- assert_equals(appHistory.entries().length, 3);
- assert_equals(fourth_entry, appHistory.entries()[2]);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(fourth_entry, navigation.entries()[2]);
history.replaceState(5, "");
- let fifth_entry = appHistory.current;
+ let fifth_entry = navigation.currentEntry;
assert_not_equals(fifth_entry, fourth_entry);
assert_equals(fifth_entry.key, fourth_entry.key);
assert_true(isUUID(fifth_entry.key));
@@ -60,11 +60,11 @@
assert_true(isUUID(fifth_entry.id));
assert_equals(fifth_entry.url, fourth_entry.url);
assert_true(fifth_entry.sameDocument);
- assert_equals(appHistory.entries().length, 3);
- assert_equals(fifth_entry, appHistory.entries()[2]);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(fifth_entry, navigation.entries()[2]);
history.pushState(5, "");
- let fifth_entry_after_push = appHistory.current;
+ let fifth_entry_after_push = navigation.currentEntry;
assert_not_equals(fifth_entry_after_push, fifth_entry);
assert_not_equals(fifth_entry_after_push.key, fifth_entry.key);
assert_true(isUUID(fifth_entry_after_push.key));
@@ -72,11 +72,11 @@
assert_true(isUUID(fifth_entry_after_push.id));
assert_equals(fifth_entry_after_push.url, fifth_entry.url);
assert_true(fifth_entry_after_push.sameDocument);
- assert_equals(appHistory.entries().length, 4);
- assert_equals(fifth_entry_after_push, appHistory.entries()[3]);
+ assert_equals(navigation.entries().length, 4);
+ assert_equals(fifth_entry_after_push, navigation.entries()[3]);
history.replaceState(5, "");
- let fifth_entry_after_replace = appHistory.current;
+ let fifth_entry_after_replace = navigation.currentEntry;
assert_not_equals(fifth_entry_after_replace, fifth_entry_after_push);
assert_equals(fifth_entry_after_replace.key, fifth_entry_after_push.key);
assert_true(isUUID(fifth_entry_after_replace.key));
@@ -84,11 +84,11 @@
assert_true(isUUID(fifth_entry_after_replace.id));
assert_equals(fifth_entry_after_replace.url, fifth_entry_after_push.url);
assert_true(fifth_entry_after_replace.sameDocument);
- assert_equals(appHistory.entries().length, 4);
- assert_equals(fifth_entry_after_replace, appHistory.entries()[3]);
+ assert_equals(navigation.entries().length, 4);
+ assert_equals(fifth_entry_after_replace, navigation.entries()[3]);
location.hash = "6";
- let sixth_entry = appHistory.current;
+ let sixth_entry = navigation.currentEntry;
assert_not_equals(sixth_entry, fifth_entry_after_replace);
assert_equals(sixth_entry.key, fifth_entry_after_replace.key);
assert_true(isUUID(sixth_entry.key));
@@ -96,12 +96,12 @@
assert_true(isUUID(sixth_entry.id));
assert_not_equals(sixth_entry.url, fifth_entry_after_replace.url);
assert_true(sixth_entry.sameDocument);
- assert_equals(appHistory.entries().length, 4);
- assert_equals(sixth_entry, appHistory.entries()[3]);
+ assert_equals(navigation.entries().length, 4);
+ assert_equals(sixth_entry, navigation.entries()[3]);
- appHistory.entries().forEach(entry => {
+ navigation.entries().forEach(entry => {
assert_true(isUUID(entry.id));
assert_true(isUUID(entry.key));
});
-}, "Basic tests for appHistory.current");
+}, "Basic tests for navigation.currentEntry");
</script>
diff --git a/app-history/app-history-entry/entries-across-origins.html b/app-history/app-history-entry/entries-across-origins.html
index b6e8e9e..447273b 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 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let start_key = i.contentWindow.appHistory.current.key;
- let start_id = i.contentWindow.appHistory.current.id;
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
let cross_origin_url = new URL("resources/post-entries-length-to-top.html", location.href);
cross_origin_url.hostname = get_host_info().REMOTE_HOST;
@@ -19,7 +19,7 @@
i.src = "/common/blank.html?2";
i.onload = t.step_func_done(() => {
- let entries = i.contentWindow.appHistory.entries();
+ let entries = i.contentWindow.navigation.entries();
assert_equals(entries.length, 1);
assert_equals(new URL(entries[0].url).search, "?2");
assert_not_equals(entries[0].key, start_key);
@@ -29,5 +29,5 @@
});
});
});
-}, "appHistory.entries() should only contain entries that are both same-origin and contiguous");
+}, "navigation.entries() should only contain entries that are both same-origin and contiguous");
</script>
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 5644d12..b54a749 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 @@
<script src="resources/is_uuid.js"></script>
<script>
-// This test ensures that appHistory.entries() in an iframe is properly updated
+// This test ensures that navigation.entries() in an iframe is properly updated
// when a page is restored from bfcache.
// First, create an iframe and do a fragment navigation in it, so that its
-// appHistory.entries().length == 2. Then go back, so that entries()[0] is
+// navigation.entries().length == 2. Then go back, so that entries()[0] is
// current. Finally, navigate the main window (which should clobber the
// the iframe's entries()[1]), and come back via bfcache. If the iframe's
// entries() were updated, then its entries().length should have been reduced
@@ -23,13 +23,13 @@
i.src = "/common/blank.html";
document.body.appendChild(i);
await new Promise(resolve => i.onload = () => setTimeout(resolve, 0));
- await i.contentWindow.appHistory.navigate("#foo");
- await i.contentWindow.appHistory.back();
- window.frames[0].appHistory.entries()[1].ondispose = () => events.push("dispose");
+ await i.contentWindow.navigation.navigate("#foo");
+ await i.contentWindow.navigation.back();
+ window.frames[0].navigation.entries()[1].ondispose = () => events.push("dispose");
window.frames[0].onpageshow = () => events.push("pageshow");
},
async funcAfterAssertion(pageA, pageB) {
- assert_equals(await pageA.execute_script(() => window.frames[0].appHistory.entries().length), 1);
+ assert_equals(await pageA.execute_script(() => window.frames[0].navigation.entries().length), 1);
assert_array_equals(await pageA.execute_script(() => window.events), ["pageshow", "dispose"]);
}
}, "entries() in an iframe must be updated after navigating back to a bfcached page");
diff --git a/app-history/app-history-entry/entries-after-bfcache.html b/app-history/app-history-entry/entries-after-bfcache.html
index 3cfe039..11bd7df 100644
--- a/app-history/app-history-entry/entries-after-bfcache.html
+++ b/app-history/app-history-entry/entries-after-bfcache.html
@@ -7,7 +7,7 @@
<script src="resources/is_uuid.js"></script>
<script>
-// This test ensures that appHistory.entries() is properly updated when a page
+// This test ensures that navigation.entries() is properly updated when a page
// is restored from bfcache. Before navigating away and back, entries() contains
// a single entry representing this document. When restored from bfcache,
// entries() should now have two entries: [0] should still be this document, but
@@ -16,11 +16,11 @@
runBfcacheTest({
targetOrigin: originSameOrigin,
funcBeforeNavigation: () => {
- window.originalEntry0 = appHistory.entries()[0];
+ window.originalEntry0 = navigation.entries()[0];
},
async funcAfterAssertion(pageA, pageB) {
const entryData = await pageA.execute_script(() => {
- return appHistory.entries().map(e => ({
+ return navigation.entries().map(e => ({
url: e.url,
key: e.key,
id: e.id,
@@ -50,10 +50,10 @@
assert_true(entryData[0].sameDocument);
assert_false(entryData[1].sameDocument);
- const currentIsZero = await pageA.execute_script(() => appHistory.current === appHistory.entries()[0]);
+ const currentIsZero = await pageA.execute_script(() => navigation.currentEntry === navigation.entries()[0]);
assert_true(currentIsZero);
- const zeroIsSameAsOriginal = await pageA.execute_script(() => appHistory.current === window.originalEntry0);
+ const zeroIsSameAsOriginal = await pageA.execute_script(() => navigation.currentEntry === window.originalEntry0);
assert_true(zeroIsSameAsOriginal);
}
}, "entries() must contain the forward-history page after navigating back to a bfcached page");
diff --git a/app-history/app-history-entry/entries-after-blank-navigation.html b/app-history/app-history-entry/entries-after-blank-navigation.html
index 6006856..6f6dbcc 100644
--- a/app-history/app-history-entry/entries-after-blank-navigation.html
+++ b/app-history/app-history-entry/entries-after-blank-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-after-blob-navigation.html b/app-history/app-history-entry/entries-after-blob-navigation.html
index c1ce46d..77c2517 100644
--- a/app-history/app-history-entry/entries-after-blob-navigation.html
+++ b/app-history/app-history-entry/entries-after-blob-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-after-cross-document-forward-pruning.html b/app-history/app-history-entry/entries-after-cross-document-forward-pruning.html
index 4888a5b..ddd1ad5 100644
--- a/app-history/app-history-entry/entries-after-cross-document-forward-pruning.html
+++ b/app-history/app-history-entry/entries-after-cross-document-forward-pruning.html
@@ -24,10 +24,10 @@
i.contentWindow.location.search = "?fork";
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
- const entries = i.contentWindow.appHistory.entries();
+ const entries = i.contentWindow.navigation.entries();
const searches = entries.map(e => (new URL(e.url)).search);
assert_array_equals(searches, ["", "?fork"]);
- assert_equals(i.contentWindow.appHistory.entries().at(-1), i.contentWindow.appHistory.current);
-}, "appHistory.entries() behavior after forward-pruning due to cross-document navs");
+ assert_equals(i.contentWindow.navigation.entries().at(-1), i.contentWindow.navigation.currentEntry);
+}, "navigation.entries() behavior after forward-pruning due to cross-document navs");
</script>
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 2ed1d81..27a07c9 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 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let start_key = i.contentWindow.appHistory.current.key;
- let start_url = i.contentWindow.appHistory.current.url;
- let start_id = i.contentWindow.appHistory.current.id;
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_url = i.contentWindow.navigation.currentEntry.url;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
let did_js_url_nav = false;
i.onload = t.step_func(() => {
if (!did_js_url_nav) {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- before_js_nav_key = i.contentWindow.appHistory.current.key;
- before_js_nav_url = i.contentWindow.appHistory.current.url;
- before_js_nav_id = i.contentWindow.appHistory.current.id;
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ before_js_nav_key = i.contentWindow.navigation.currentEntry.key;
+ before_js_nav_url = i.contentWindow.navigation.currentEntry.url;
+ before_js_nav_id = i.contentWindow.navigation.currentEntry.id;
i.src = "javascript:'new content'";
did_js_url_nav = true;
} else {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- let first_entry = i.contentWindow.appHistory.entries()[0];
- let js_url_entry = i.contentWindow.appHistory.entries()[1];
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ let first_entry = i.contentWindow.navigation.entries()[0];
+ let js_url_entry = i.contentWindow.navigation.entries()[1];
assert_equals(first_entry.key, start_key);
assert_equals(first_entry.url, start_url);
assert_equals(first_entry.id, start_id);
- assert_equals(js_url_entry, i.contentWindow.appHistory.current);
+ assert_equals(js_url_entry, i.contentWindow.navigation.currentEntry);
assert_equals(js_url_entry.key, before_js_nav_key);
assert_equals(js_url_entry.url, before_js_nav_url);
assert_not_equals(js_url_entry.id, before_js_nav_id);
t.done();
}
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
});
}, "AppHistory behavior after navigation to a javascript: url");
</script>
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 55cb58e..d1d4d86 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 @@
<iframe id="i" src="/common/blank.html"></iframe>
<script>
async_test(t => {
- // The navigations in each window should have only added an appHistory to
+ // The navigations in each window should have only added an navigation to
// their own window.
function assertExpectedEntries(entries, expected_url) {
assert_equals(entries.length, 2);
@@ -25,10 +25,10 @@
window.onload = () => t.step_timeout(t.step_func(() => {
location.hash = "#1";
i.onload = t.step_func_done(() => {
- assertExpectedEntries(appHistory.entries(), location.href);
- assertExpectedEntries(i.contentWindow.appHistory.entries(), i.contentWindow.location.href);
+ assertExpectedEntries(navigation.entries(), location.href);
+ assertExpectedEntries(i.contentWindow.navigation.entries(), i.contentWindow.location.href);
});
i.contentWindow.location = "/common/blank.html?2";
}), 0);
-}, "appHistory.entries() behavior when multiple windows navigate.");
+}, "navigation.entries() behavior when multiple windows navigate.");
</script>
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 cfb1337..434b376 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 e6eb998..98efb6b 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 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- assert_not_equals(appHistory.entries(), appHistory.entries());
-}, "appHistory.entries() should not return an identical object on repeated invocations");
+ assert_not_equals(navigation.entries(), navigation.entries());
+}, "navigation.entries() should not return an identical object on repeated invocations");
</script>
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 de7d681..cd4279a 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");
</script>
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 7ef6b4d..d261efd 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");
</script>
diff --git a/app-history/app-history-entry/entries-when-inactive.html b/app-history/app-history-entry/entries-when-inactive.html
index a707377..c70b6d8 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 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- const first_entry = appHistory.entries()[0];
+ const first_entry = navigation.entries()[0];
history.pushState(1, "", "#1");
- assert_equals(appHistory.entries()[0], first_entry);
+ assert_equals(navigation.entries()[0], first_entry);
history.back();
window.onpopstate = t.step_func_done(() => {
- const second_entry = appHistory.entries()[1];
+ const second_entry = navigation.entries()[1];
history.replaceState(0, "", "#0");
- assert_equals(appHistory.entries()[1], second_entry);
+ assert_equals(navigation.entries()[1], second_entry);
});
-}, "A non-active entry in appHistory.entries() should not be modified when a different entry is modified");
+}, "A non-active entry in navigation.entries() should not be modified when a different entry is modified");
</script>
diff --git a/app-history/app-history-entry/entry-after-detach.html b/app-history/app-history-entry/entry-after-detach.html
index dc31f1a..83962d2 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 @@
<script>
async_test(t => {
window.onload = t.step_func_done(() => {
- let i_entry = i.contentWindow.appHistory.current;
+ let i_entry = i.contentWindow.navigation.currentEntry;
assert_true(i_entry.sameDocument);
assert_not_equals(i_entry.url, null);
assert_not_equals(i_entry.key, "");
diff --git a/app-history/app-history-entry/index-not-in-entries.html b/app-history/app-history-entry/index-not-in-entries.html
index 394dfa9..37cccd3 100644
--- a/app-history/app-history-entry/index-not-in-entries.html
+++ b/app-history/app-history-entry/index-not-in-entries.html
@@ -8,13 +8,13 @@
// into a replace navigation.
window.onload = () => t.step_timeout(t.step_func_done(() => {
// Remove the entry by replacing it.
- let replaced_entry = appHistory.current;
+ let replaced_entry = navigation.currentEntry;
assert_equals(replaced_entry.index, 0);
- appHistory.navigate("#0", { replace: true });
+ navigation.navigate("#0", { replace: true });
assert_equals(replaced_entry.index, -1);
// Remove the entry by detaching its window.
- let iframe_entry = i.contentWindow.appHistory.current;
+ let iframe_entry = i.contentWindow.navigation.currentEntry;
assert_equals(iframe_entry.index, 0);
i.remove();
assert_equals(iframe_entry.index, -1);
diff --git a/app-history/app-history-entry/key-id-back-cross-document.html b/app-history/app-history-entry/key-id-back-cross-document.html
index 9fbb733..f0dc182 100644
--- a/app-history/app-history-entry/key-id-back-cross-document.html
+++ b/app-history/app-history-entry/key-id-back-cross-document.html
@@ -8,8 +8,8 @@
assert_equals(window.start_key, end_key);
assert_equals(window.start_id, end_id);
// The new history entry in the iframe should not add any entries to
- // this window's appHistory.
- assert_equals(appHistory.entries().length, 1);
+ // this window's navigation.
+ assert_equals(navigation.entries().length, 1);
});
}, "AppHistoryEntry's key and id on cross-document back navigation");
</script>
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 94319c3..b5137f3 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 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- let key = appHistory.current.key;
- let id = appHistory.current.id;
- assert_equals(appHistory.entries().length, 1);
+ let key = navigation.currentEntry.key;
+ let id = navigation.currentEntry.id;
+ assert_equals(navigation.entries().length, 1);
history.pushState("hash", "", "#hash");
- assert_not_equals(key, appHistory.current.key);
- assert_not_equals(id, appHistory.current.id);
- assert_equals(appHistory.entries().length, 2);
- assert_equals(appHistory.current.index, 1);
+ assert_not_equals(key, navigation.currentEntry.key);
+ assert_not_equals(id, navigation.currentEntry.id);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(navigation.currentEntry.index, 1);
window.onpopstate = t.step_func_done(() => {
- assert_equals(key, appHistory.current.key);
- assert_equals(id, appHistory.current.id);
- assert_equals(appHistory.entries().length, 2);
- assert_equals(appHistory.current.index, 0);
+ assert_equals(key, navigation.currentEntry.key);
+ assert_equals(id, navigation.currentEntry.id);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(navigation.currentEntry.index, 0);
});
history.back();
}, "AppHistoryEntry's key and id on same-document back navigation");
diff --git a/app-history/app-history-entry/key-id-location-reload-transitionWhile.html b/app-history/app-history-entry/key-id-location-reload-transitionWhile.html
index b26e279..a06b645 100644
--- a/app-history/app-history-entry/key-id-location-reload-transitionWhile.html
+++ b/app-history/app-history-entry/key-id-location-reload-transitionWhile.html
@@ -7,17 +7,17 @@
await new Promise(resolve => { window.onload = resolve; });
- const original = i.contentWindow.appHistory.current;
+ const original = i.contentWindow.navigation.currentEntry;
const { key, id } = original;
- i.contentWindow.appHistory.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
+ i.contentWindow.navigation.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
i.onload = t.unreached_func("the iframe must not reload");
await i.contentWindow.location.reload();
- assert_equals(i.contentWindow.appHistory.current, original);
- assert_equals(i.contentWindow.appHistory.current.key, key);
- assert_equals(i.contentWindow.appHistory.current.id, id);
+ assert_equals(i.contentWindow.navigation.currentEntry, original);
+ assert_equals(i.contentWindow.navigation.currentEntry.key, key);
+ assert_equals(i.contentWindow.navigation.currentEntry.id, id);
}, "AppHistoryEntry's key and id after location.reload() intercepted by transitionWhile()");
</script>
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 6604270..267906d 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 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let key = i.contentWindow.appHistory.current.key;
- let id = i.contentWindow.appHistory.current.id;
+ let key = i.contentWindow.navigation.currentEntry.key;
+ let id = i.contentWindow.navigation.currentEntry.id;
i.contentWindow.location.reload();
i.onload = t.step_func_done(() => {
- assert_equals(key, i.contentWindow.appHistory.current.key);
- assert_equals(id, i.contentWindow.appHistory.current.id);
- assert_equals(appHistory.entries().length, 1);
+ assert_equals(key, i.contentWindow.navigation.currentEntry.key);
+ assert_equals(id, i.contentWindow.navigation.currentEntry.id);
+ assert_equals(navigation.entries().length, 1);
});
});
}, "AppHistoryEntry's key and id after location.reload()");
diff --git a/app-history/app-history-entry/key-id-location-replace-cross-origin.html b/app-history/app-history-entry/key-id-location-replace-cross-origin.html
index b49c601..ee0f749 100644
--- a/app-history/app-history-entry/key-id-location-replace-cross-origin.html
+++ b/app-history/app-history-entry/key-id-location-replace-cross-origin.html
@@ -6,7 +6,7 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let key_before_replace = i.contentWindow.appHistory.current.key;
+ let key_before_replace = i.contentWindow.navigation.currentEntry.key;
window.onmessage = t.step_func_done(e => assert_not_equals(key_before_replace, e.data));
let cross_origin_url = new URL("resources/post-key-to-top.html", location.href);
diff --git a/app-history/app-history-entry/key-id-location-replace.html b/app-history/app-history-entry/key-id-location-replace.html
index 9d245b1..ec96371 100644
--- a/app-history/app-history-entry/key-id-location-replace.html
+++ b/app-history/app-history-entry/key-id-location-replace.html
@@ -5,13 +5,13 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let key = i.contentWindow.appHistory.current.key;
- let id = i.contentWindow.appHistory.current.id;
+ let key = i.contentWindow.navigation.currentEntry.key;
+ let id = i.contentWindow.navigation.currentEntry.id;
i.contentWindow.location.replace("/common/blank.html?query");
i.onload = t.step_func_done(() => {
- assert_equals(key, i.contentWindow.appHistory.current.key);
- assert_not_equals(id, i.contentWindow.appHistory.current.id);
- assert_equals(appHistory.entries().length, 1);
+ assert_equals(key, i.contentWindow.navigation.currentEntry.key);
+ assert_not_equals(id, i.contentWindow.navigation.currentEntry.id);
+ assert_equals(navigation.entries().length, 1);
});
});
}, "AppHistoryEntry's key and id after location.replace()");
diff --git a/app-history/app-history-entry/no-referrer-dynamic-url-censored.html b/app-history/app-history-entry/no-referrer-dynamic-url-censored.html
index 91484da..7a5544c 100644
--- a/app-history/app-history-entry/no-referrer-dynamic-url-censored.html
+++ b/app-history/app-history-entry/no-referrer-dynamic-url-censored.html
@@ -9,25 +9,25 @@
await new Promise(r => window.onload = () => t.step_timeout(r, 0));
// The entry for the first document has a visible url.
- i.contentWindow.appHistory.navigate("/common/blank.html?2");
+ i.contentWindow.navigation.navigate("/common/blank.html?2");
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
- assert_not_equals(i.contentWindow.appHistory.entries()[0].url, null);
+ assert_not_equals(i.contentWindow.navigation.entries()[0].url, null);
// Apply no-referrer, the url should now be censored when no longer on that document.
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
i.contentDocument.head.innerHTML = `<meta name="referrer" content="no-referrer">`;
- assert_not_equals(i.contentWindow.appHistory.entries()[0].url, null);
- i.contentWindow.appHistory.forward();
+ assert_not_equals(i.contentWindow.navigation.entries()[0].url, null);
+ i.contentWindow.navigation.forward();
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
- assert_equals(i.contentWindow.appHistory.entries()[0].url, null);
+ assert_equals(i.contentWindow.navigation.entries()[0].url, null);
// Overwrite the referrer policy, the url should be visible again.
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
i.contentDocument.head.innerHTML = `<meta name="referrer" content="same-origin">`;
- i.contentWindow.appHistory.forward();
+ i.contentWindow.navigation.forward();
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
- assert_not_equals(i.contentWindow.appHistory.entries()[0].url, null);
+ assert_not_equals(i.contentWindow.navigation.entries()[0].url, null);
}, "The url of a document is censored by a no-referrer policy dynamically");
</script>
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 0f23f3b..e23c58a 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");
</script>
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 2db4253..f7a5547 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");
</script>
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 a1e765d..3275a30 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,<script>top.postMessage({ length: appHistory.entries().length, " +
- "currentIsNull: appHistory.current === null}, '*')</sc" +
+ i.src = "data:text/html,<script>top.postMessage({ length: navigation.entries().length, " +
+ "currentIsNull: navigation.currentEntry === null}, '*')</sc" +
"ript>";
});
}, "AppHistory behavior after navigation to a data: URL (which has an opaque origin)");
diff --git a/app-history/app-history-entry/resources/key-navigate-back-cross-document-helper.html b/app-history/app-history-entry/resources/key-navigate-back-cross-document-helper.html
index f61f9a8..79f3c3d 100644
--- a/app-history/app-history-entry/resources/key-navigate-back-cross-document-helper.html
+++ b/app-history/app-history-entry/resources/key-navigate-back-cross-document-helper.html
@@ -5,23 +5,23 @@
// into a replace navigation.
window.onload = () => step_timeout(() => {
if (location.search == "?go-back") {
- assert_equals(appHistory.entries().length, 2);
- assert_equals(appHistory.current.index, 1);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(navigation.currentEntry.index, 1);
// Step 2: Navigate back.
history.back();
return;
}
if (top.start_key) {
- assert_equals(appHistory.entries().length, 2);
- assert_equals(appHistory.current.index, 0);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(navigation.currentEntry.index, 0);
// Step 3: Notify parent, which will ensure the same key is used after back navigation.
- top.finish(appHistory.current.key, appHistory.current.id);
+ top.finish(navigation.currentEntry.key, navigation.currentEntry.id);
return;
}
// Step 1: Record initial key and navigate.
- assert_equals(appHistory.entries().length, 1);
- top.start_key = appHistory.current.key;
- top.start_id = appHistory.current.id;
+ assert_equals(navigation.entries().length, 1);
+ top.start_key = navigation.currentEntry.key;
+ top.start_id = navigation.currentEntry.id;
location.search = "go-back";
}, 0);
</script>
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 5e8a719..98e2c1b 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");
</script>
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 348a898..c8fe005 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 @@
<script>
// Wait for after the load event so that the navigation doesn't get converted
// into a replace navigation.
-window.onload = () => step_timeout(() => top.postMessage(appHistory.entries().length, "*"), 0);
+window.onload = () => step_timeout(() => top.postMessage(navigation.entries().length, "*"), 0);
</script>
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 023141f..285f345 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 @@
<script>
-top.postMessage(appHistory.current.key, "*");
+top.postMessage(navigation.currentEntry.key, "*");
</script>
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 732b109..acb67ee 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");
</script>
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 0c8abb4e..fd21bc2 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 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- await i.contentWindow.appHistory.navigate("#foo");
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_true(i.contentWindow.appHistory.entries()[0].sameDocument);
+ await i.contentWindow.navigation.navigate("#foo");
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_true(i.contentWindow.navigation.entries()[0].sameDocument);
- i.contentWindow.appHistory.navigate("/common/blank.html?bar");
+ i.contentWindow.navigation.navigate("/common/blank.html?bar");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 3);
- assert_false(i.contentWindow.appHistory.entries()[0].sameDocument);
- assert_false(i.contentWindow.appHistory.entries()[1].sameDocument);
+ assert_equals(i.contentWindow.navigation.entries().length, 3);
+ assert_false(i.contentWindow.navigation.entries()[0].sameDocument);
+ assert_false(i.contentWindow.navigation.entries()[1].sameDocument);
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 3);
- assert_equals(i.contentWindow.appHistory.current.index, 1);
- assert_true(i.contentWindow.appHistory.entries()[0].sameDocument);
- assert_false(i.contentWindow.appHistory.entries()[2].sameDocument);
+ assert_equals(i.contentWindow.navigation.entries().length, 3);
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
+ assert_true(i.contentWindow.navigation.entries()[0].sameDocument);
+ assert_false(i.contentWindow.navigation.entries()[2].sameDocument);
}, "entry.sameDocument is properly restored after cross-document back");
</script>
diff --git a/app-history/app-history-entry/sameDocument-after-navigate.html b/app-history/app-history-entry/sameDocument-after-navigate.html
index 1e984b3..e1376a0 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 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let i_entry = i.contentWindow.appHistory.current;
+ let i_entry = i.contentWindow.navigation.currentEntry;
assert_true(i_entry.sameDocument);
i.onload = t.step_func_done(() => assert_false(i_entry.sameDocument));
i.contentWindow.location = "about:blank";
diff --git a/app-history/app-history-entry/state-after-navigate-restore.html b/app-history/app-history-entry/state-after-navigate-restore.html
index aad0650..57fe38a 100644
--- a/app-history/app-history-entry/state-after-navigate-restore.html
+++ b/app-history/app-history-entry/state-after-navigate-restore.html
@@ -5,23 +5,23 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- await i.contentWindow.appHistory.navigate("#start", { replace: true, state: "someState" });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.entries()[0].getState(), "someState");
+ await i.contentWindow.navigation.navigate("#start", { replace: true, state: "someState" });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.entries()[0].getState(), "someState");
- await i.contentWindow.appHistory.navigate("#foo");
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.entries()[0].getState(), "someState");
+ await i.contentWindow.navigation.navigate("#foo");
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.entries()[0].getState(), "someState");
- i.contentWindow.appHistory.navigate("/common/blank.html?bar");
+ i.contentWindow.navigation.navigate("/common/blank.html?bar");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 3);
- assert_equals(i.contentWindow.appHistory.entries()[0].getState(), "someState");
+ assert_equals(i.contentWindow.navigation.entries().length, 3);
+ assert_equals(i.contentWindow.navigation.entries()[0].getState(), "someState");
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 3);
- assert_equals(i.contentWindow.appHistory.current.index, 1);
- assert_equals(i.contentWindow.appHistory.entries()[0].getState(), "someState");
+ assert_equals(i.contentWindow.navigation.entries().length, 3);
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
+ assert_equals(i.contentWindow.navigation.entries()[0].getState(), "someState");
}, "entry.getState() is properly restored after cross-document back");
</script>
diff --git a/app-history/currentchange-event/currentchange-anchor-href.html b/app-history/currentchange-event/currentchange-anchor-href.html
index 2a93abf..55e4556 100644
--- a/app-history/currentchange-event/currentchange-anchor-href.html
+++ b/app-history/currentchange-event/currentchange-anchor-href.html
@@ -4,15 +4,15 @@
<a id="a" href="#foo"></a>
<script>
test(t => {
- 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.from.index, 0);
assert_equals(e.navigationType, "push");
- assert_equals(appHistory.current.index, 1);
+ assert_equals(navigation.currentEntry.index, 1);
});
a.click();
- assert_true(oncurrentchange_called);
+ assert_true(oncurrententrychange_called);
}, "AppHistoryCurrentChangeEvent fires for link click");
</script>
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 7782d11..df230bd 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 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.navigate("/common/blank.html?1");
+ i.contentWindow.navigation.navigate("/common/blank.html?1");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire for cross-document navigations");
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations");
+ i.contentWindow.navigation.back();
await new Promise(resolve => i.onload = resolve);
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire for cross-document navigations");
- i.contentWindow.appHistory.forward();
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations");
+ i.contentWindow.navigation.forward();
await new Promise(resolve => i.onload = resolve);
-}, "AppHistoryCurrentChangeEvent does not fire for cross-document appHistory.back() and appHistory.forward()");
+}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.back() and navigation.forward()");
</script>
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 8cfe2dc..41cc4af 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()");
</script>
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 d6a657a..2f804a3 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 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire for cross-document navigations");
- i.contentWindow.appHistory.navigate("/common/blank.html?1");
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations");
+ i.contentWindow.navigation.navigate("/common/blank.html?1");
await new Promise(resolve => i.onload = resolve);
-}, "AppHistoryCurrentChangeEvent does not fire for cross-document appHistory.navigate()");
+}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.navigate()");
</script>
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 82f1000..997fb55 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 @@
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
- appHistory.oncurrentchange = t.unreached_func("currentchange should not fire");
- appHistory.onnavigate = e => e.preventDefault();
- await promise_rejects_dom(t, "AbortError", appHistory.navigate("#foo").committed);
+ navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire");
+ navigation.onnavigate = e => e.preventDefault();
+ await promise_rejects_dom(t, "AbortError", navigation.navigate("#foo").committed);
}, "AppHistoryCurrentChangeEvent does not fire when onnavigate preventDefault() is called");
</script>
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 3d8ceb7..52478f2 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 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire for cross-document navigations");
- i.contentWindow.appHistory.navigate("/common/blank.html?1", { replace: true });
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations");
+ i.contentWindow.navigation.navigate("/common/blank.html?1", { replace: true });
await new Promise(resolve => i.onload = resolve);
-}, "AppHistoryCurrentChangeEvent does not fire for cross-document appHistory.navigate() with replace");
+}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.navigate() with replace");
</script>
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 fa7006b..a402770 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");
</script>
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 86079e7..55b314a 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");
</script>
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 d74048a..96de3de 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()");
</script>
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 d6a39d2..2132016 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");
</script>
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 ae142fb..cb4279c 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 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire for cross-document navigations");
- i.contentWindow.appHistory.reload();
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations");
+ i.contentWindow.navigation.reload();
await new Promise(resolve => i.onload = resolve);
-}, "AppHistoryCurrentChangeEvent does not fire for cross-document appHistory.reload()");
+}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.reload()");
</script>
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 d1f022f..cfa6258 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");
</script>
diff --git a/app-history/currentchange-event/currentchange-app-history-updateCurrent.html b/app-history/currentchange-event/currentchange-app-history-updateCurrent.html
index 9e3a3ec..8d54870 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 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- let oncurrentchange_count = 0;
- appHistory.oncurrentchange = t.step_func(e => {
- oncurrentchange_count++;
- assert_equals(e.from, appHistory.current);
+ let oncurrententrychange_count = 0;
+ navigation.oncurrententrychange = t.step_func(e => {
+ oncurrententrychange_count++;
+ assert_equals(e.from, navigation.currentEntry);
assert_equals(e.navigationType, null);
- assert_equals(appHistory.current.getState(), "newState");
+ assert_equals(navigation.currentEntry.getState(), "newState");
});
- appHistory.updateCurrent({ state: "newState" });
- assert_equals(oncurrentchange_count, 1);
+ navigation.updateCurrentEntry({ state: "newState" });
+ assert_equals(oncurrententrychange_count, 1);
- // "Updating" the state to the current state should still fire currentchange.
- appHistory.updateCurrent({ state: appHistory.current.getState() });
- assert_equals(oncurrentchange_count, 2);
-}, "AppHistoryCurrentChangeEvent fires for appHistory.updateCurrent()");
+ // "Updating" the state to the current state should still fire currententrychange.
+ navigation.updateCurrentEntry({ state: navigation.currentEntry.getState() });
+ assert_equals(oncurrententrychange_count, 2);
+}, "AppHistoryCurrentChangeEvent fires for navigation.updateCurrentEntry()");
</script>
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 a90ee1e..bee3649 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()");
</script>
diff --git a/app-history/currentchange-event/currentchange-history-pushState.html b/app-history/currentchange-event/currentchange-history-pushState.html
index e5468ea..c0e2d9a 100644
--- a/app-history/currentchange-event/currentchange-history-pushState.html
+++ b/app-history/currentchange-event/currentchange-history-pushState.html
@@ -3,14 +3,14 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- 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);
});
history.pushState(1, "", "#1");
- assert_true(oncurrentchange_called);
+ assert_true(oncurrententrychange_called);
}, "AppHistoryCurrentChangeEvent fires for history.pushState()");
</script>
diff --git a/app-history/currentchange-event/currentchange-history-replaceState.html b/app-history/currentchange-event/currentchange-history-replaceState.html
index 5a99561..da5505a 100644
--- a/app-history/currentchange-event/currentchange-history-replaceState.html
+++ b/app-history/currentchange-event/currentchange-history-replaceState.html
@@ -3,16 +3,16 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- let oncurrentchange_called = false;
- let original_current = appHistory.current;
- appHistory.oncurrentchange = t.step_func(e => {
- oncurrentchange_called = true;
- assert_equals(e.from, original_current);
+ let oncurrententrychange_called = false;
+ let original_currentEntry = navigation.currentEntry;
+ navigation.oncurrententrychange = t.step_func(e => {
+ oncurrententrychange_called = true;
+ assert_equals(e.from, original_currentEntry);
assert_equals(e.from.index, -1);
assert_equals(e.navigationType, "replace");
- assert_equals(appHistory.current.index, 0);
+ assert_equals(navigation.currentEntry.index, 0);
});
history.replaceState(1, "", "#1");
- assert_true(oncurrentchange_called);
+ assert_true(oncurrententrychange_called);
}, "AppHistoryCurrentChangeEvent fires for history.replaceState()");
</script>
diff --git a/app-history/currentchange-event/currentchange-location-api.html b/app-history/currentchange-event/currentchange-location-api.html
index 8cf52ca..f06dc8e 100644
--- a/app-history/currentchange-event/currentchange-location-api.html
+++ b/app-history/currentchange-event/currentchange-location-api.html
@@ -3,16 +3,16 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- 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);
});
location.hash = "#foo";
- assert_true(oncurrentchange_called);
+ assert_true(oncurrententrychange_called);
}, "AppHistoryCurrentChangeEvent fires for location API navigations");
</script>
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 8473e0b..a8aa2a2 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 @@
<script>
promise_test(async t => {
const w = window.open("about:blank#1");
- w.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire");
+ w.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire");
assert_equals(w.location.href, "about:blank#1");
w.location.href = "about:blank#2";
diff --git a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc.html b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc.html
index e595868..e2c5674 100644
--- a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc.html
+++ b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank-same-doc.html
@@ -4,7 +4,7 @@
<iframe id="i"></iframe>
<script>
promise_test(async t => {
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire");
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire");
i.contentWindow.location.href = "about:blank#1";
i.contentWindow.location.href = "about:blank#2";
await new Promise(resolve => t.step_timeout(resolve, 10));
diff --git a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank.html b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank.html
index 415fb0c..7b406c7 100644
--- a/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank.html
+++ b/app-history/currentchange-event/currentchange-navigate-from-initial-about-blank.html
@@ -4,8 +4,8 @@
<iframe id="i"></iframe>
<script>
promise_test(async t => {
- i.contentWindow.appHistory.oncurrentchange = t.unreached_func("currentchange should not fire");
- i.contentWindow.appHistory.navigate("/common/blank.html");
+ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire");
+ i.contentWindow.navigation.navigate("/common/blank.html");
await new Promise(resolve => t.step_timeout(resolve, 10));
}, "AppHistoryCurrentChangeEvent does not fire when navigating away from the initial about:blank");
</script>
diff --git a/app-history/currentchange-event/currentchange-properties.html b/app-history/currentchange-event/currentchange-properties.html
index a5417fa..7048034 100644
--- a/app-history/currentchange-event/currentchange-properties.html
+++ b/app-history/currentchange-event/currentchange-properties.html
@@ -3,7 +3,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- appHistory.oncurrentchange = t.step_func_done(e => {
+ navigation.oncurrententrychange = t.step_func_done(e => {
assert_equals(e.constructor, AppHistoryCurrentChangeEvent);
assert_false(e.bubbles);
assert_false(e.cancelable);
diff --git a/app-history/currentchange-event/event-constructor.html b/app-history/currentchange-event/event-constructor.html
index 6c48936..64ea8cf 100644
--- a/app-history/currentchange-event/event-constructor.html
+++ b/app-history/currentchange-event/event-constructor.html
@@ -4,29 +4,29 @@
<script>
test(() => {
assert_throws_js(TypeError, () => {
- new AppHistoryCurrentChangeEvent("currentchange");
+ new AppHistoryCurrentChangeEvent("currententrychange");
});
}, "can't bypass required members by omitting the dictionary entirely");
test(() => {
assert_throws_js(TypeError, () => {
- new AppHistoryCurrentChangeEvent("currentchange", {
+ new AppHistoryCurrentChangeEvent("currententrychange", {
navigationType: "push"
});
});
}, "from is required");
test(() => {
- const event = new AppHistoryCurrentChangeEvent("currentchange", {
+ const event = new AppHistoryCurrentChangeEvent("currententrychange", {
navigationType: "replace",
- from: appHistory.current
+ from: navigation.currentEntry
});
assert_equals(event.navigationType, "replace");
- assert_equals(event.from, appHistory.current);
+ assert_equals(event.from, navigation.currentEntry);
}, "all properties are reflected back");
test(t => {
- const event = new AppHistoryCurrentChangeEvent("currentchange", { from: appHistory.current });
+ const event = new AppHistoryCurrentChangeEvent("currententrychange", { from: navigation.currentEntry });
assert_equals(event.navigationType, null);
}, "defaults are as expected");
</script>
diff --git a/app-history/focus-reset/autofocus.html b/app-history/focus-reset/autofocus.html
index 57fdf86..9bd4ea3 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 fb57cf8..8a62d88 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 d38df57..c1d0285 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 e3012a0..e7e9a52 100644
--- a/app-history/focus-reset/resources/helpers.mjs
+++ b/app-history/focus-reset/resources/helpers.mjs
@@ -13,7 +13,7 @@
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 @@
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 24abe7f..d162d8d 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 6fb559c..2f40238 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 <a> element that navigates cross-document targeting a cross-origin window");
</script>
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 ed1e8a3..928d202 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 @@
<script>
async_test(t => {
- 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(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.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-samedocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/click-samedocument-crossorigin-sameorigindomain.sub.html
index 0df9ec6..b7d2840 100644
--- a/app-history/navigate-event/cross-window/click-samedocument-crossorigin-sameorigindomain.sub.html
+++ b/app-history/navigate-event/cross-window/click-samedocument-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-samedocument-crossorigin.html b/app-history/navigate-event/cross-window/click-samedocument-crossorigin.html
index 7973f0d..32bc4cd 100644
--- a/app-history/navigate-event/cross-window/click-samedocument-crossorigin.html
+++ b/app-history/navigate-event/cross-window/click-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(() => link.click());
}, "clicking on an <a> element that navigates same-document targeting a cross-origin window");
</script>
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 a2532fc..fc815ab 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -21,7 +21,7 @@
assert_equals(e.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(() => link.click());
}, "clicking on an <a> element that navigates same-document targeting a same-origin window");
</script>
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 2623b4b..24824b1 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 b0f031c..79df86f 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");
</script>
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 0232969..1ac3eef 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -20,7 +20,7 @@
assert_equals(e.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(() => i.contentWindow.location.href = "/common/blank.html?foo");
}, "using location.href to navigate cross-document targeting a same-origin window");
</script>
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 ec97236..96032c1 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 b5d4fbf..8a58be7 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");
</script>
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 634b4f7..3901b9d 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -20,7 +20,7 @@
assert_equals(e.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(() => i.contentWindow.location.href = "/common/blank.html#foo");
}, "using location.href to navigate same-document targeting a same-origin window");
</script>
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 edbcee5..d386e48 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 88e975a..73ede89 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");
</script>
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 8a23dce..a899dd8 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -20,7 +20,7 @@
assert_equals(e.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("/common/blank.html?foo", "windowname"));
}, "using window.open() to navigate cross-document targeting a same-origin window");
</script>
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 c072ed9..b44303c 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 e7fe633..65f062f 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");
</script>
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 bab8161..3f3c38d 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -20,7 +20,7 @@
assert_equals(e.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("/common/blank.html#foo", "windowname"));
}, "using window.open() to navigate same-document targeting a same-origin window");
</script>
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 48a5e1d..96e8a0c 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 @@
<script>
-appHistory.onnavigate = e => {
+navigation.onnavigate = e => {
const message = {
navigationType: e.navigationType,
cancelable: e.cancelable,
diff --git a/app-history/navigate-event/cross-window/submit-crossdocument-crossorigin-sameorigindomain.sub.html b/app-history/navigate-event/cross-window/submit-crossdocument-crossorigin-sameorigindomain.sub.html
index 794eccf..36101a4 100644
--- a/app-history/navigate-event/cross-window/submit-crossdocument-crossorigin-sameorigindomain.sub.html
+++ b/app-history/navigate-event/cross-window/submit-crossdocument-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-crossdocument-crossorigin.html b/app-history/navigate-event/cross-window/submit-crossdocument-crossorigin.html
index 4356a12..007f58b 100644
--- a/app-history/navigate-event/cross-window/submit-crossdocument-crossorigin.html
+++ b/app-history/navigate-event/cross-window/submit-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(() => form.submit());
}, "submitting a <form> element that navigates cross-document targeting a cross-origin window");
</script>
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 4552353..93b9735 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -21,7 +21,7 @@
assert_equals(e.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 <form> element that navigates cross-document targeting a same-origin window");
</script>
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 4f84e6a..9f5ba8b 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 7e25d17..51a313a 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 <form> element that navigates same-document targeting a cross-origin window");
</script>
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 12de577..f0b7b73 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 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push", "navigationType");
assert_true(e.cancelable, "cancelable");
assert_true(e.canTransition, "canTransition");
@@ -21,7 +21,7 @@
assert_equals(e.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 <form> element that navigates same-document targeting a same-origin window");
</script>
diff --git a/app-history/navigate-event/event-constructor.html b/app-history/navigate-event/event-constructor.html
index 7a8803f..501857f 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 a6d395a..55ecbe7 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 @@
<a id="a" href="https://does-not-exist/foo.html"></a>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_false(e.canTransition);
diff --git a/app-history/navigate-event/navigate-anchor-fragment.html b/app-history/navigate-event/navigate-anchor-fragment.html
index 77cf94a..b61edbe 100644
--- a/app-history/navigate-event/navigate-anchor-fragment.html
+++ b/app-history/navigate-event/navigate-anchor-fragment.html
@@ -4,7 +4,7 @@
<a id="a" href="#1"></a>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-anchor-same-origin-cross-document.html b/app-history/navigate-event/navigate-anchor-same-origin-cross-document.html
index ac8f548..3f846c7 100644
--- a/app-history/navigate-event/navigate-anchor-same-origin-cross-document.html
+++ b/app-history/navigate-event/navigate-anchor-same-origin-cross-document.html
@@ -4,7 +4,7 @@
<a id="a" href="foo.html"></a>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-anchor-userInitiated.html b/app-history/navigate-event/navigate-anchor-userInitiated.html
index 8afe01d..c54f525 100644
--- a/app-history/navigate-event/navigate-anchor-userInitiated.html
+++ b/app-history/navigate-event/navigate-anchor-userInitiated.html
@@ -7,7 +7,7 @@
<a id="a" href="#1">Click me</a>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-anchor-with-target.html b/app-history/navigate-event/navigate-anchor-with-target.html
index cf69358..b9add6c 100644
--- a/app-history/navigate-event/navigate-anchor-with-target.html
+++ b/app-history/navigate-event/navigate-anchor-with-target.html
@@ -6,10 +6,10 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.step_func_done(() => {
+ navigation.onnavigate = t.step_func_done(() => {
assert_unreached("onnavigate should not have fired in source window");
});
- iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-appHistory-back-cross-document.html b/app-history/navigate-event/navigate-appHistory-back-cross-document.html
index 2be9cb9..a3641d5 100644
--- a/app-history/navigate-event/navigate-appHistory-back-cross-document.html
+++ b/app-history/navigate-event/navigate-appHistory-back-cross-document.html
@@ -5,11 +5,11 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let target_key = i.contentWindow.appHistory.current.key;
- let target_id = i.contentWindow.appHistory.current.id;
- i.contentWindow.appHistory.navigate("?foo");
+ let target_key = i.contentWindow.navigation.currentEntry.key;
+ let target_id = i.contentWindow.navigation.currentEntry.id;
+ i.contentWindow.navigation.navigate("?foo");
i.onload = t.step_func(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_false(e.cancelable);
assert_false(e.canTransition);
@@ -23,9 +23,9 @@
assert_equals(e.formData, null);
assert_equals(e.info, "hi");
});
- assert_true(i.contentWindow.appHistory.canGoBack);
- i.contentWindow.appHistory.back({ info: "hi" });
+ assert_true(i.contentWindow.navigation.canGoBack);
+ i.contentWindow.navigation.back({ info: "hi" });
})
});
-}, "navigate event for appHistory.back() - cross-document");
+}, "navigate event for navigation.back() - cross-document");
</script>
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 acc71ad..22fe9fa 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");
</script>
diff --git a/app-history/navigate-event/navigate-appHistory-navigate.html b/app-history/navigate-event/navigate-appHistory-navigate.html
index b48e816..5629f76 100644
--- a/app-history/navigate-event/navigate-appHistory-navigate.html
+++ b/app-history/navigate-event/navigate-appHistory-navigate.html
@@ -3,7 +3,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
assert_true(e.canTransition);
@@ -16,6 +16,6 @@
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
});
- appHistory.navigate("#foo");
-}, "navigate event for appHistory.navigate()");
+ navigation.navigate("#foo");
+}, "navigate event for navigation.navigate()");
</script>
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 07e66b8..8fc0f2d1 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");
</script>
diff --git a/app-history/navigate-event/navigate-destination-getState-navigate.html b/app-history/navigate-event/navigate-destination-getState-navigate.html
index 43ca7b4..9c34c57 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()");
</script>
diff --git a/app-history/navigate-event/navigate-form-get.html b/app-history/navigate-event/navigate-form-get.html
index 8438491..3c76acc 100644
--- a/app-history/navigate-event/navigate-form-get.html
+++ b/app-history/navigate-event/navigate-form-get.html
@@ -4,7 +4,7 @@
<form id="form" action=""></form>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
e.preventDefault();
assert_equals(e.navigationType, "replace");
diff --git a/app-history/navigate-event/navigate-form-reload.html b/app-history/navigate-event/navigate-form-reload.html
index fbab4d2..f18a11e 100644
--- a/app-history/navigate-event/navigate-form-reload.html
+++ b/app-history/navigate-event/navigate-form-reload.html
@@ -6,15 +6,15 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.step_func_done(() => {
+ navigation.onnavigate = t.step_func_done(() => {
assert_unreached("onnavigate should not have fired in source window");
});
- iframe.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_not_equals(e.formData, null);
iframe.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, "reload");
assert_equals(e.formData, null);
});
diff --git a/app-history/navigate-event/navigate-form-traverse.html b/app-history/navigate-event/navigate-form-traverse.html
index 1514b2b..d673537 100644
--- a/app-history/navigate-event/navigate-form-traverse.html
+++ b/app-history/navigate-event/navigate-form-traverse.html
@@ -6,23 +6,23 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.step_func_done(() => {
+ navigation.onnavigate = t.step_func_done(() => {
assert_unreached("onnavigate should not have fired in source window");
});
- iframe.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_not_equals(e.formData, null);
iframe.onload = t.step_func(() => {
// Avoid the replace behavior that occurs if you navigate during the load handler
t.step_timeout(() => {
- iframe.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_equals(e.formData, null);
});
iframe.contentWindow.onhashchange = 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, "traverse");
assert_equals(e.formData, null);
});
diff --git a/app-history/navigate-event/navigate-form-userInitiated.html b/app-history/navigate-event/navigate-form-userInitiated.html
index e1c8c28..74fc750 100644
--- a/app-history/navigate-event/navigate-form-userInitiated.html
+++ b/app-history/navigate-event/navigate-form-userInitiated.html
@@ -9,7 +9,7 @@
</form>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
e.preventDefault();
assert_equals(e.navigationType, "push");
diff --git a/app-history/navigate-event/navigate-form-with-target.html b/app-history/navigate-event/navigate-form-with-target.html
index dcbbdc0..87ae7ba 100644
--- a/app-history/navigate-event/navigate-form-with-target.html
+++ b/app-history/navigate-event/navigate-form-with-target.html
@@ -6,9 +6,9 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
+ navigation.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
- iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-form.html b/app-history/navigate-event/navigate-form.html
index 8413c48..3aee2d7 100644
--- a/app-history/navigate-event/navigate-form.html
+++ b/app-history/navigate-event/navigate-form.html
@@ -4,7 +4,7 @@
<form id="form" method="post" action=""></form>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
e.preventDefault();
assert_equals(e.navigationType, "replace");
diff --git a/app-history/navigate-event/navigate-history-back-after-fragment.html b/app-history/navigate-event/navigate-history-back-after-fragment.html
index 307fe57..31107fb 100644
--- a/app-history/navigate-event/navigate-history-back-after-fragment.html
+++ b/app-history/navigate-event/navigate-history-back-after-fragment.html
@@ -5,12 +5,12 @@
async_test(t => {
window.onload = () => t.step_timeout(() => {
let start_length = history.length;
- let target_key = appHistory.current.key;
- let target_id = appHistory.current.id;
+ let target_key = navigation.currentEntry.key;
+ let target_id = navigation.currentEntry.id;
location.hash = "#1";
assert_equals(history.length, start_length + 1);
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_false(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-history-back-after-pushState.html b/app-history/navigate-event/navigate-history-back-after-pushState.html
index 74f353d..0232517 100644
--- a/app-history/navigate-event/navigate-history-back-after-pushState.html
+++ b/app-history/navigate-event/navigate-history-back-after-pushState.html
@@ -5,12 +5,12 @@
async_test(t => {
window.onload = () => t.step_timeout(() => {
let start_length = history.length;
- let target_key = appHistory.current.key;
- let target_id = appHistory.current.id;
+ let target_key = navigation.currentEntry.key;
+ let target_id = navigation.currentEntry.id;
history.pushState(1, "", "pushState.html");
assert_equals(history.length, start_length + 1);
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_false(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-history-back-cross-document.html b/app-history/navigate-event/navigate-history-back-cross-document.html
index c6c8322..5d7c662 100644
--- a/app-history/navigate-event/navigate-history-back-cross-document.html
+++ b/app-history/navigate-event/navigate-history-back-cross-document.html
@@ -5,11 +5,11 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- let target_key = i.contentWindow.appHistory.current.key;
- let target_id = i.contentWindow.appHistory.current.id;
- i.contentWindow.appHistory.navigate("?foo");
+ let target_key = i.contentWindow.navigation.currentEntry.key;
+ let target_id = i.contentWindow.navigation.currentEntry.id;
+ i.contentWindow.navigation.navigate("?foo");
i.onload = t.step_func(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_false(e.cancelable);
assert_false(e.canTransition);
@@ -23,7 +23,7 @@
assert_equals(e.formData, null);
assert_equals(e.info, undefined);
});
- assert_true(i.contentWindow.appHistory.canGoBack);
+ assert_true(i.contentWindow.navigation.canGoBack);
i.contentWindow.history.back();
})
});
diff --git a/app-history/navigate-event/navigate-history-go-0.html b/app-history/navigate-event/navigate-history-go-0.html
index 2070614..6f7b277 100644
--- a/app-history/navigate-event/navigate-history-go-0.html
+++ b/app-history/navigate-event/navigate-history-go-0.html
@@ -5,7 +5,7 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "reload");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-history-pushState.html b/app-history/navigate-event/navigate-history-pushState.html
index b7940f1..5cd4ed8 100644
--- a/app-history/navigate-event/navigate-history-pushState.html
+++ b/app-history/navigate-event/navigate-history-pushState.html
@@ -4,7 +4,7 @@
<script>
async_test(t => {
let start_length = history.length;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-history-replaceState.html b/app-history/navigate-event/navigate-history-replaceState.html
index dda602d..b5637d6 100644
--- a/app-history/navigate-event/navigate-history-replaceState.html
+++ b/app-history/navigate-event/navigate-history-replaceState.html
@@ -4,7 +4,7 @@
<script>
async_test(t => {
let start_length = history.length;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-iframe-location.html b/app-history/navigate-event/navigate-iframe-location.html
index 8abaabb..e566cdd 100644
--- a/app-history/navigate-event/navigate-iframe-location.html
+++ b/app-history/navigate-event/navigate-iframe-location.html
@@ -5,10 +5,10 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.step_func_done(() => {
+ navigation.onnavigate = t.step_func_done(() => {
assert_unreached("onnavigate should not have fired in source window");
});
- iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-location.html b/app-history/navigate-event/navigate-location.html
index ec17dcf..e0c22d3 100644
--- a/app-history/navigate-event/navigate-location.html
+++ b/app-history/navigate-event/navigate-location.html
@@ -4,7 +4,7 @@
<form id="form" action=""></form>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-meta-refresh.html b/app-history/navigate-event/navigate-meta-refresh.html
index 4f3769d..0f2994a 100644
--- a/app-history/navigate-event/navigate-meta-refresh.html
+++ b/app-history/navigate-event/navigate-meta-refresh.html
@@ -7,7 +7,7 @@
<script>
async_test(t => {
i.onload = t.step_func(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "reload");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-to-javascript.html b/app-history/navigate-event/navigate-to-javascript.html
index 53ce37a..78f490d 100644
--- a/app-history/navigate-event/navigate-to-javascript.html
+++ b/app-history/navigate-event/navigate-to-javascript.html
@@ -6,9 +6,9 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
+ navigation.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
- iframe.contentWindow.appHistory.onnavigate = t.unreached_func("onnavigate should not have fired in iframe window");
+ iframe.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not have fired in iframe window");
iframe.contentWindow.location.href = "javascript:'foo'";
diff --git a/app-history/navigate-event/navigate-to-srcdoc.html b/app-history/navigate-event/navigate-to-srcdoc.html
index b9d315d..344d130 100644
--- a/app-history/navigate-event/navigate-to-srcdoc.html
+++ b/app-history/navigate-event/navigate-to-srcdoc.html
@@ -6,9 +6,9 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
+ navigation.onnavigate = t.unreached_func("onnavigate should not have fired in source window");
- iframe.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable, "cancelable");
assert_false(e.canTransition, "canTransition");
diff --git a/app-history/navigate-event/navigate-window-open-self.html b/app-history/navigate-event/navigate-window-open-self.html
index 1523ed8..4409cb2 100644
--- a/app-history/navigate-event/navigate-window-open-self.html
+++ b/app-history/navigate-event/navigate-window-open-self.html
@@ -3,7 +3,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigate-window-open.html b/app-history/navigate-event/navigate-window-open.html
index 03cd14e..b0cac18 100644
--- a/app-history/navigate-event/navigate-window-open.html
+++ b/app-history/navigate-event/navigate-window-open.html
@@ -5,10 +5,10 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- appHistory.onnavigate = t.step_func_done(() => {
+ navigation.onnavigate = t.step_func_done(() => {
assert_unreached("onnavigate should not have fired in source window");
});
- iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
assert_true(e.canTransition);
diff --git a/app-history/navigate-event/navigatesuccess-same-document.html b/app-history/navigate-event/navigatesuccess-same-document.html
index 0333089..6007170 100644
--- a/app-history/navigate-event/navigatesuccess-same-document.html
+++ b/app-history/navigate-event/navigatesuccess-same-document.html
@@ -4,7 +4,7 @@
<a id="a" href="#1"></a>
<script>
async_test(t => {
- appHistory.onnavigatesuccess = t.step_func_done(() => assert_equals(location.hash, "#1"));
+ navigation.onnavigatesuccess = t.step_func_done(() => assert_equals(location.hash, "#1"));
a.click();
}, "navigatesuccess fires for a same-document navigation");
</script>
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 c073184..aabc501 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 @@
<!doctype html>
<head>
<script>
-appHistory.onnavigatesuccess = () => top.postMessage("navigatesuccess received");
+navigation.onnavigatesuccess = () => top.postMessage("navigatesuccess received");
</script>
</head>
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 19ab7ae..adef895 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 f9a1cd7..f281617 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 82d0c07..d90ee5b 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 108ef39..aad3be3 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 00be992..dde666c 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 03c36f7..49399fb 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 f4cc707..7f4a25c 100644
--- a/app-history/navigate-event/transitionWhile-after-dispatch.html
+++ b/app-history/navigate-event/transitionWhile-after-dispatch.html
@@ -4,7 +4,7 @@
<iframe id="i" src="/common/blank.html"></iframe>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
t.step_timeout(t.step_func_done(() => {
assert_equals(e.eventPhase, Event.NONE);
assert_throws_dom("InvalidStateError", () => e.transitionWhile(Promise.resolve()));
diff --git a/app-history/navigate-event/transitionWhile-and-navigate.html b/app-history/navigate-event/transitionWhile-and-navigate.html
index 65e9d04..f226371 100644
--- a/app-history/navigate-event/transitionWhile-and-navigate.html
+++ b/app-history/navigate-event/transitionWhile-and-navigate.html
@@ -6,22 +6,22 @@
// Wait for after the load event so that the navigation doesn't get converted
// into a replace navigation.
await new Promise(r => window.onload = () => t.step_timeout(r, 0));
- await appHistory.navigate("#1").finished;
+ await navigation.navigate("#1").finished;
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve());
- appHistory.oncurrentchange = e => {
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve());
+ navigation.oncurrententrychange = e => {
if (e.navigationType == "traverse") {
assert_equals(location.hash, "");
- assert_equals(appHistory.current.index, 0);
- assert_equals(appHistory.entries().length, 2);
- appHistory.navigate("#2");
+ assert_equals(navigation.currentEntry.index, 0);
+ assert_equals(navigation.entries().length, 2);
+ navigation.navigate("#2");
}
};
- let back_result = appHistory.back();
+ let back_result = navigation.back();
await back_result.committed;
assert_equals(location.hash, "#2");
await promise_rejects_dom(t, "AbortError", back_result.finished);
- assert_equals(appHistory.current.index, 1);
- assert_equals(appHistory.entries().length, 2);
-}, "Using transitionWhile() then navigate() in the ensuing currentchange should abort the finished promise (but not the committed promise)");
+ assert_equals(navigation.currentEntry.index, 1);
+ assert_equals(navigation.entries().length, 2);
+}, "Using transitionWhile() then navigate() in the ensuing currententrychange should abort the finished promise (but not the committed promise)");
</script>
diff --git a/app-history/navigate-event/transitionWhile-appHistory-back.html b/app-history/navigate-event/transitionWhile-appHistory-back.html
index c05e7d3..a0bc453 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()");
</script>
diff --git a/app-history/navigate-event/transitionWhile-canceled-event.html b/app-history/navigate-event/transitionWhile-canceled-event.html
index 79ed057..ed6dbdc 100644
--- a/app-history/navigate-event/transitionWhile-canceled-event.html
+++ b/app-history/navigate-event/transitionWhile-canceled-event.html
@@ -5,7 +5,7 @@
<script>
test(t => {
let assertionHappened = false;
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
e.preventDefault();
assert_throws_dom("InvalidStateError", () => e.transitionWhile(Promise.resolve()));
assertionHappened = true;
diff --git a/app-history/navigate-event/transitionWhile-cross-document-same-origin.html b/app-history/navigate-event/transitionWhile-cross-document-same-origin.html
index 249641d..79e03f1 100644
--- a/app-history/navigate-event/transitionWhile-cross-document-same-origin.html
+++ b/app-history/navigate-event/transitionWhile-cross-document-same-origin.html
@@ -5,7 +5,7 @@
<script>
async_test(t => {
let target_url = location.href + "?1";
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_true(e.cancelable);
assert_true(e.canTransition);
assert_false(e.userInitiated);
diff --git a/app-history/navigate-event/transitionWhile-cross-origin.html b/app-history/navigate-event/transitionWhile-cross-origin.html
index d828c5c..ece79d2 100644
--- a/app-history/navigate-event/transitionWhile-cross-origin.html
+++ b/app-history/navigate-event/transitionWhile-cross-origin.html
@@ -4,7 +4,7 @@
<script src="/common/get-host-info.sub.js"></script>
<script>
async_test(t => {
- appHistory.onnavigate = t.step_func_done(e => {
+ navigation.onnavigate = t.step_func_done(e => {
assert_true(e.cancelable);
assert_false(e.canTransition);
assert_false(e.userInitiated);
diff --git a/app-history/navigate-event/transitionWhile-detach.html b/app-history/navigate-event/transitionWhile-detach.html
index 76b6241..d6a7d53 100644
--- a/app-history/navigate-event/transitionWhile-detach.html
+++ b/app-history/navigate-event/transitionWhile-detach.html
@@ -5,7 +5,7 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func_done(e => {
let iframe_constructor = i.contentWindow.DOMException;
i.remove();
assert_throws_dom("InvalidStateError", iframe_constructor, () => e.transitionWhile(Promise.resolve()));
diff --git a/app-history/navigate-event/transitionWhile-history-pushState.html b/app-history/navigate-event/transitionWhile-history-pushState.html
index 81da433..fb6152f 100644
--- a/app-history/navigate-event/transitionWhile-history-pushState.html
+++ b/app-history/navigate-event/transitionWhile-history-pushState.html
@@ -4,7 +4,7 @@
<script>
async_test(t => {
let start_length = history.length;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(() => {
resolve();
t.step_timeout(t.step_func_done(() => {
diff --git a/app-history/navigate-event/transitionWhile-history-replaceState.html b/app-history/navigate-event/transitionWhile-history-replaceState.html
index 41c4949..00f85dc 100644
--- a/app-history/navigate-event/transitionWhile-history-replaceState.html
+++ b/app-history/navigate-event/transitionWhile-history-replaceState.html
@@ -4,7 +4,7 @@
<script>
async_test(t => {
let start_length = history.length;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(() => {
resolve();
t.step_timeout(t.step_func_done(() => {
diff --git a/app-history/navigate-event/transitionWhile-multiple-times-reject.html b/app-history/navigate-event/transitionWhile-multiple-times-reject.html
index 6f40cf6..c325829 100644
--- a/app-history/navigate-event/transitionWhile-multiple-times-reject.html
+++ b/app-history/navigate-event/transitionWhile-multiple-times-reject.html
@@ -8,8 +8,8 @@
let onnavigateerror_called = false;
let caught_rejection = false;
- appHistory.onnavigatesuccess = t.step_func(assert_unreached);
- appHistory.onnavigateerror = t.step_func(e => {
+ navigation.onnavigatesuccess = t.step_func(assert_unreached);
+ navigation.onnavigateerror = t.step_func(e => {
onnavigateerror_called = true;
assert_equals(location.hash, "#1");
assert_equals(e.constructor, ErrorEvent);
@@ -19,13 +19,13 @@
assert_greater_than(e.colno, 0);
assert_greater_than(e.lineno, 0);
});
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
e.transitionWhile(Promise.resolve());
e.transitionWhile(new Promise((resolve, reject) => t.step_timeout(() => reject(err), 1)));
e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 1)));
});
- await appHistory.navigate("#1").finished.catch(t.step_func(e => {
+ await navigation.navigate("#1").finished.catch(t.step_func(e => {
caught_rejection = true;
assert_equals(e, err);
}));
diff --git a/app-history/navigate-event/transitionWhile-multiple-times.html b/app-history/navigate-event/transitionWhile-multiple-times.html
index a409db8..0f6caf1 100644
--- a/app-history/navigate-event/transitionWhile-multiple-times.html
+++ b/app-history/navigate-event/transitionWhile-multiple-times.html
@@ -6,7 +6,7 @@
let p1_resolved = false;
let p2_resolved = false;
let p3_resolved = false;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
let p1 = Promise.resolve().then(t.step_func(() => {
assert_false(p2_resolved);
assert_false(p3_resolved);
@@ -27,7 +27,7 @@
e.transitionWhile(p3);
});
- let promise = appHistory.navigate("#1").finished;
+ let promise = navigation.navigate("#1").finished;
assert_equals(location.hash, "#1");
assert_false(p1_resolved);
assert_false(p2_resolved);
@@ -37,5 +37,5 @@
assert_true(p1_resolved);
assert_true(p2_resolved);
assert_true(p3_resolved);
-}, "appHistory.navigate() returns a finished promise that awaits all promises if AppHistoryNavigateEvent's transitionWhile() is called multiple times");
+}, "navigation.navigate() returns a finished promise that awaits all promises if AppHistoryNavigateEvent's transitionWhile() is called multiple times");
</script>
diff --git a/app-history/navigate-event/transitionWhile-on-synthetic-event.html b/app-history/navigate-event/transitionWhile-on-synthetic-event.html
index a3bb80f..21a32e7 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 @@
<script>
async_test(t => {
// We need to grab an AppHistoryDestination to construct the event.
- 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/transitionWhile-reject.html b/app-history/navigate-event/transitionWhile-reject.html
index 33e0214..2cdea05 100644
--- a/app-history/navigate-event/transitionWhile-reject.html
+++ b/app-history/navigate-event/transitionWhile-reject.html
@@ -6,8 +6,8 @@
const err = new TypeError("a message");
let start_href = location.href;
- appHistory.onnavigatesuccess = t.step_func_done(assert_unreached);
- appHistory.onnavigateerror = t.step_func_done(e => {
+ navigation.onnavigatesuccess = t.step_func_done(assert_unreached);
+ navigation.onnavigateerror = t.step_func_done(e => {
assert_equals(location.hash, "#1");
assert_equals(e.constructor, ErrorEvent);
assert_true(e.error === err);
@@ -16,7 +16,7 @@
assert_greater_than(e.colno, 0);
assert_greater_than(e.lineno, 0);
});
- appHistory.onnavigate = e => {
+ navigation.onnavigate = e => {
e.transitionWhile(new Promise((resolve, reject) => t.step_timeout(() => reject(err), 0)));
};
diff --git a/app-history/navigate-event/transitionWhile-resolve.html b/app-history/navigate-event/transitionWhile-resolve.html
index 32a47ec..2ee4fb3 100644
--- a/app-history/navigate-event/transitionWhile-resolve.html
+++ b/app-history/navigate-event/transitionWhile-resolve.html
@@ -3,14 +3,14 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
- appHistory.onnavigatesuccess = t.step_func_done(e => {
+ navigation.onnavigatesuccess = t.step_func_done(e => {
assert_equals(location.hash, "#1");
assert_equals(e.constructor, Event);
assert_false(e.bubbles);
assert_false(e.cancelable);
});
- appHistory.onnavigateerror = t.step_func_done(assert_unreached);
- appHistory.onnavigate = e => {
+ navigation.onnavigateerror = t.step_func_done(assert_unreached);
+ navigation.onnavigate = e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 0)));
};
diff --git a/app-history/navigate-event/transitionWhile-same-document-history-back.html b/app-history/navigate-event/transitionWhile-same-document-history-back.html
index 587a6bd..5e8ac39 100644
--- a/app-history/navigate-event/transitionWhile-same-document-history-back.html
+++ b/app-history/navigate-event/transitionWhile-same-document-history-back.html
@@ -8,30 +8,30 @@
window.onload = () => t.step_timeout(() => {
let onnavigate_calls = 0;
let onnavigatesuccess_calls = 0;
- appHistory.onnavigate = e => {
+ navigation.onnavigate = e => {
onnavigate_calls++;
e.transitionWhile(Promise.resolve());
}
- appHistory.onnavigatesuccess = t.step_func(e => {
+ navigation.onnavigatesuccess = t.step_func(e => {
onnavigatesuccess_calls++;
if (onnavigatesuccess_calls == 3) {
- assert_equals(appHistory.entries().length, 3);
- assert_equals(appHistory.current.index, 1);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(navigation.currentEntry.index, 1);
assert_equals(onnavigate_calls, 3);
history.back();
} else if (onnavigatesuccess_calls == 4) {
- assert_equals(appHistory.entries().length, 3);
- assert_equals(appHistory.current.index, 0);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(navigation.currentEntry.index, 0);
assert_equals(onnavigate_calls, 4);
t.done();
}
});
- appHistory.navigate("?foo").finished
- .then(t.step_func(() => appHistory.navigate("?bar").finished))
+ navigation.navigate("?foo").finished
+ .then(t.step_func(() => navigation.navigate("?bar").finished))
.then(t.step_func(() => {
- assert_equals(appHistory.entries().length, 3);
- assert_equals(appHistory.current.index, 2);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(navigation.currentEntry.index, 2);
assert_equals(onnavigate_calls, 2);
history.back();
}));
diff --git a/app-history/navigate/back-forward-multiple-frames.html b/app-history/navigate/back-forward-multiple-frames.html
index 80a8fb6..738bfd3 100644
--- a/app-history/navigate/back-forward-multiple-frames.html
+++ b/app-history/navigate/back-forward-multiple-frames.html
@@ -8,67 +8,67 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
// Step 1
- assert_equals(appHistory.entries().length, 1, "step 1 outer entries() length");
- assert_equals(i.contentWindow.appHistory.entries().length, 1, "step 1 iframe entries() length");
- await appHistory.navigate("#top").committed;
+ assert_equals(navigation.entries().length, 1, "step 1 outer entries() length");
+ assert_equals(i.contentWindow.navigation.entries().length, 1, "step 1 iframe entries() length");
+ await navigation.navigate("#top").committed;
// Step 2: iframe at initial entry, top on second entry
- assert_equals(appHistory.entries().length, 2, "step 2 outer entries() length");
- assert_equals(i.contentWindow.appHistory.entries().length, 1, "step 2 iframe entries() length");
- await i.contentWindow.appHistory.navigate("#iframe").committed;
+ assert_equals(navigation.entries().length, 2, "step 2 outer entries() length");
+ assert_equals(i.contentWindow.navigation.entries().length, 1, "step 2 iframe entries() length");
+ await i.contentWindow.navigation.navigate("#iframe").committed;
// Step 3: Both windows on second entry.
- assert_equals(appHistory.entries().length, 2, "step 3 outer entries() length");
- assert_equals(i.contentWindow.appHistory.entries().length, 2, "step 3 iframe entries() length");
- assert_equals(appHistory.current.index, 1, "step 3 outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 1, "step 1 iframe index");
+ assert_equals(navigation.entries().length, 2, "step 3 outer entries() length");
+ assert_equals(i.contentWindow.navigation.entries().length, 2, "step 3 iframe entries() length");
+ assert_equals(navigation.currentEntry.index, 1, "step 3 outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1, "step 1 iframe index");
// NOTE: the order of navigation in the two windows is not guaranteed; we need to wait for both.
// Going back in the iframe should go 3->2 (navigating iframe only)
await Promise.all([
- i.contentWindow.appHistory.back().committed,
+ i.contentWindow.navigation.back().committed,
new Promise(resolve => i.contentWindow.onpopstate = resolve)
]);
- assert_equals(appHistory.current.index, 1, "after iframe back() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 0, "after iframe back() iframe index");
+ assert_equals(navigation.currentEntry.index, 1, "after iframe back() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 0, "after iframe back() iframe index");
// Going forward in iframe should go 2->3
await Promise.all([
- i.contentWindow.appHistory.forward().commited,
+ i.contentWindow.navigation.forward().commited,
new Promise(resolve => i.contentWindow.onpopstate = resolve)
]);
- assert_equals(appHistory.current.index, 1, "after iframe forward() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 1, "after iframe forward() iframe index");
+ assert_equals(navigation.currentEntry.index, 1, "after iframe forward() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1, "after iframe forward() iframe index");
// Going back in top should go 3->1 (navigating both windows).
await Promise.all([
- appHistory.back().commited,
+ navigation.back().commited,
new Promise(resolve => i.contentWindow.onpopstate = resolve)
]);
- assert_equals(appHistory.current.index, 0, "after outer back() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 0, "after outer back() iframe index");
+ assert_equals(navigation.currentEntry.index, 0, "after outer back() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 0, "after outer back() iframe index");
// Next two should not navigate the iframe
i.contentWindow.onpopstate = t.unreached_func("popstate must not be called");
// Going forward in top should go 1->2 (navigating top only)
- await appHistory.forward().committed;
+ await navigation.forward().committed;
await new Promise(resolve => t.step_timeout(resolve, 0));
- assert_equals(appHistory.current.index, 1, "after outer forward() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 0, "after outer forward() iframe index");
+ assert_equals(navigation.currentEntry.index, 1, "after outer forward() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 0, "after outer forward() iframe index");
// Going back in top should go 2->1
- await appHistory.back().committed;
+ await navigation.back().committed;
await new Promise(resolve => t.step_timeout(resolve, 0));
- assert_equals(appHistory.current.index, 0, "after outer second back() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 0, "after outer second back() iframe index");
+ assert_equals(navigation.currentEntry.index, 0, "after outer second back() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 0, "after outer second back() iframe index");
// Going forward in iframe should go 1->3 (navigating both windows)
await Promise.all([
- i.contentWindow.appHistory.forward().commited,
+ i.contentWindow.navigation.forward().commited,
new Promise(resolve => i.contentWindow.onpopstate = resolve)
]);
- assert_equals(appHistory.current.index, 1, "after iframe second forward() outer index");
- assert_equals(i.contentWindow.appHistory.current.index, 1, "after iframe second forward() iframe index");
-}, "appHistory.back() and appHistory.forward() can navigate multiple frames");
+ assert_equals(navigation.currentEntry.index, 1, "after iframe second forward() outer index");
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1, "after iframe second forward() iframe index");
+}, "navigation.back() and navigation.forward() can navigate multiple frames");
</script>
diff --git a/app-history/navigate/disambigaute-back.html b/app-history/navigate/disambigaute-back.html
index 7a4a37d..d44d435 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");
</script>
diff --git a/app-history/navigate/disambigaute-forward.html b/app-history/navigate/disambigaute-forward.html
index b6508ed..e252e30 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");
</script>
diff --git a/app-history/navigate/disambigaute-goto-back-multiple.html b/app-history/navigate/disambigaute-goto-back-multiple.html
index c39da79..03a8eb1 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");
</script>
diff --git a/app-history/navigate/disambigaute-goto-forward-multiple.html b/app-history/navigate/disambigaute-goto-forward-multiple.html
index 08c0058..f8e78c4 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");
</script>
diff --git a/app-history/navigate/forward-to-pruned-entry.html b/app-history/navigate/forward-to-pruned-entry.html
index 0e33360..b8bd36e 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");
</script>
diff --git a/app-history/navigate/goTo-after-adding-iframe.html b/app-history/navigate/goTo-after-adding-iframe.html
index 9921bcf..5ab2820 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");
</script>
</body>
diff --git a/app-history/navigate/goTo-after-data-url.html b/app-history/navigate/goTo-after-data-url.html
index ba2b56d..0b21a74 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");
</script>
</body>
diff --git a/app-history/navigate/goTo-cross-document.html b/app-history/navigate/goTo-cross-document.html
index 0a7bbbe..2540639 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()");
</script>
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 2849ee1..9a95295 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");
</script>
diff --git a/app-history/navigate/goTo-multiple-steps.html b/app-history/navigate/goTo-multiple-steps.html
index 562a775..059eb21 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");
</script>
diff --git a/app-history/navigate/goTo-same-document.html b/app-history/navigate/goTo-same-document.html
index a9af0c2..1a32bce 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()");
</script>
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 3da2955..a6b7745 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");
</script>
</body>
diff --git a/app-history/navigate/navigate-base-url.html b/app-history/navigate/navigate-base-url.html
index b11a71a..00fefa6 100644
--- a/app-history/navigate/navigate-base-url.html
+++ b/app-history/navigate/navigate-base-url.html
@@ -5,11 +5,11 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.navigate("blank.html");
+ i.contentWindow.navigation.navigate("blank.html");
i.onload = t.step_func_done(() => {
- const iframeURL = new URL(i.contentWindow.appHistory.current.url);
+ const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframeURL.pathname, "/common/blank.html");
});
});
-}, "navigate() must resolve URLs relative to appHistory object's base URL");
+}, "navigate() must resolve URLs relative to navigation object's base URL");
</script>
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 83cd776..2044b33 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 @@
<!--
Sort of a regression test for https://bugs.chromium.org/p/chromium/issues/detail?id=1289864,
but since that is GC-dependent this will probably not fail in codebases that exhibit that bug.
- So it's really just adding some extra general coverage for appHistory.navigate().
+ So it's really just adding some extra general coverage for navigation.navigate().
TODO(domenic): when https://github.com/web-platform-tests/wpt/issues/7899 happens, update this
test to use TestUtils.gc().
@@ -14,9 +14,9 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.navigate("/common/blank.html?1");
+ i.contentWindow.navigation.navigate("/common/blank.html?1");
i.onload = t.step_func_done(() => {
- const iframeURL = new URL(i.contentWindow.appHistory.current.url);
+ const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframeURL.pathname, "/common/blank.html");
assert_equals(iframeURL.search, "?1");
});
diff --git a/app-history/navigate/navigate-from-initial-about-blank.html b/app-history/navigate/navigate-from-initial-about-blank.html
index fd163dd..d494ec4 100644
--- a/app-history/navigate/navigate-from-initial-about-blank.html
+++ b/app-history/navigate/navigate-from-initial-about-blank.html
@@ -6,7 +6,7 @@
<!--
Sort of a regression test for https://bugs.chromium.org/p/chromium/issues/detail?id=1289864,
but since that is GC-dependent this will probably not fail in codebases that exhibit that bug.
- So it's really just adding some extra general coverage for appHistory.navigate().
+ So it's really just adding some extra general coverage for navigation.navigate().
TODO(domenic): when https://github.com/web-platform-tests/wpt/issues/7899 happens, update this
test to use TestUtils.gc().
@@ -15,9 +15,9 @@
<script>
async_test(t => {
- i.contentWindow.appHistory.navigate("/common/blank.html?1");
+ i.contentWindow.navigation.navigate("/common/blank.html?1");
i.onload = t.step_func_done(() => {
- const iframeURL = new URL(i.contentWindow.appHistory.current.url);
+ const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframeURL.pathname, "/common/blank.html");
assert_equals(iframeURL.search, "?1");
});
diff --git a/app-history/navigate/navigate-history-state-replace.html b/app-history/navigate/navigate-history-state-replace.html
index b4b9559..f3dbce8 100644
--- a/app-history/navigate/navigate-history-state-replace.html
+++ b/app-history/navigate/navigate-history-state-replace.html
@@ -7,8 +7,8 @@
assert_equals(history.state, "state1");
let onnavigate_called = false;
- appHistory.onnavigate = () => onnavigate_called = true;
- await appHistory.navigate("#2", { replace: true }).committed;
+ navigation.onnavigate = () => onnavigate_called = true;
+ await navigation.navigate("#2", { replace: true }).committed;
assert_equals(location.hash, "#2");
assert_true(onnavigate_called);
assert_equals(history.state, null);
diff --git a/app-history/navigate/navigate-history-state.html b/app-history/navigate/navigate-history-state.html
index 8853c06..0541636 100644
--- a/app-history/navigate/navigate-history-state.html
+++ b/app-history/navigate/navigate-history-state.html
@@ -7,8 +7,8 @@
assert_equals(history.state, "state1");
let onnavigate_called = false;
- appHistory.onnavigate = () => onnavigate_called = true;
- await appHistory.navigate("#2").committed;
+ navigation.onnavigate = () => onnavigate_called = true;
+ await navigation.navigate("#2").committed;
assert_equals(location.hash, "#2");
assert_true(onnavigate_called);
assert_equals(history.state, null);
diff --git a/app-history/navigate/navigate-info-and-state.html b/app-history/navigate/navigate-info-and-state.html
index 8890c9b..828d7da 100644
--- a/app-history/navigate/navigate-info-and-state.html
+++ b/app-history/navigate/navigate-info-and-state.html
@@ -6,13 +6,13 @@
let navInfo = { nav : "info" };
let navState = { statevar: "state" };
let onnavigated_called = false;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
onnavigated_called = true;
assert_equals(e.info, navInfo)
});
- await appHistory.navigate("#1", { info: navInfo, state: navState }).committed;
+ await navigation.navigate("#1", { info: navInfo, state: navState }).committed;
assert_true(onnavigated_called);
- assert_not_equals(appHistory.current.getState(), navState);
- assert_equals(appHistory.current.getState().statevar, navState.statevar);
+ assert_not_equals(navigation.currentEntry.getState(), navState);
+ assert_equals(navigation.currentEntry.getState().statevar, navState.statevar);
}, "navigate() with info and state");
</script>
diff --git a/app-history/navigate/navigate-relative-url.html b/app-history/navigate/navigate-relative-url.html
index b426da5..cc95d5e 100644
--- a/app-history/navigate/navigate-relative-url.html
+++ b/app-history/navigate/navigate-relative-url.html
@@ -5,12 +5,12 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
i.onload = t.step_func_done(() => {
- let iframe_url = new URL(i.contentWindow.appHistory.current.url);
+ let iframe_url = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframe_url.search, "?1");
assert_equals(iframe_url.pathname, "/common/blank.html");
});
});
-}, "navigate() should resolve urls relative to appHistory object, not the caller");
+}, "navigate() should resolve urls relative to navigation object, not the caller");
</script>
diff --git a/app-history/navigate/navigate-replace-cross-document.html b/app-history/navigate/navigate-replace-cross-document.html
index 0b20dc8..02068d9 100644
--- a/app-history/navigate/navigate-replace-cross-document.html
+++ b/app-history/navigate/navigate-replace-cross-document.html
@@ -8,19 +8,19 @@
// into a replace navigation (which would defeat the point of the test).
window.onload = () => t.step_timeout(() => {
let start_history_length = history.length;
- let start_entry_top = appHistory.current;
- let start_entry_iframe_id = i.contentWindow.appHistory.current.id;
- let start_entry_iframe_key = i.contentWindow.appHistory.current.key;
+ let start_entry_top = navigation.currentEntry;
+ let start_entry_iframe_id = i.contentWindow.navigation.currentEntry.id;
+ let start_entry_iframe_key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1", { replace: true });
+ i.contentWindow.navigation.navigate("?1", { replace: true });
i.onload = t.step_func_done(() => {
assert_equals(history.length, start_history_length);
- assert_equals(appHistory.entries().length, 1);
- assert_equals(appHistory.current, start_entry_top);
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(navigation.currentEntry, start_entry_top);
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let iframe_entry = i.contentWindow.appHistory.current;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let iframe_entry = i.contentWindow.navigation.currentEntry;
assert_not_equals(start_entry_iframe_id, iframe_entry.id);
assert_equals(start_entry_iframe_key, iframe_entry.key);
});
diff --git a/app-history/navigate/navigate-replace-same-document.html b/app-history/navigate/navigate-replace-same-document.html
index dea17f4..cc2ea3a 100644
--- a/app-history/navigate/navigate-replace-same-document.html
+++ b/app-history/navigate/navigate-replace-same-document.html
@@ -7,14 +7,14 @@
// into a replace navigation.
window.onload = () => t.step_timeout(t.step_func_done(async () => {
let start_history_length = history.length;
- let key1 = appHistory.current.key;
- await appHistory.navigate("#1").committed;
- let key2 = appHistory.current.key;
+ let key1 = navigation.currentEntry.key;
+ await navigation.navigate("#1").committed;
+ let key2 = navigation.currentEntry.key;
assert_not_equals(key1, key2);
- await appHistory.navigate("#2", { replace: true }).committed;
- let key3 = appHistory.current.key;
+ await navigation.navigate("#2", { replace: true }).committed;
+ let key3 = navigation.currentEntry.key;
assert_equals(key2, key3);
- assert_equals(appHistory.entries().length, 2);
+ assert_equals(navigation.entries().length, 2);
assert_equals(history.length, start_history_length + 1);
}), 0);
}, "navigate() with replace option");
diff --git a/app-history/navigate/navigate-same-document.html b/app-history/navigate/navigate-same-document.html
index bad4202..9ffd824 100644
--- a/app-history/navigate/navigate-same-document.html
+++ b/app-history/navigate/navigate-same-document.html
@@ -5,8 +5,8 @@
<script>
promise_test(async () => {
let onnavigate_called = false;
- appHistory.onnavigate = () => onnavigate_called = true;
- await appHistory.navigate("#d").committed;
+ navigation.onnavigate = () => onnavigate_called = true;
+ await navigation.navigate("#d").committed;
assert_equals(location.hash, "#d");
assert_true(onnavigate_called);
assert_equals(document.querySelector(":target"), d);
@@ -14,8 +14,8 @@
test(() => {
let onnavigate_called = false;
- appHistory.onnavigate = () => onnavigate_called = true;
- appHistory.navigate("#d");
+ navigation.onnavigate = () => onnavigate_called = true;
+ navigation.navigate("#d");
assert_equals(location.hash, "#d");
assert_true(onnavigate_called);
assert_equals(document.querySelector(":target"), d);
diff --git a/app-history/navigate/navigate-state-repeated-await.html b/app-history/navigate/navigate-state-repeated-await.html
index d81dd05..a003992 100644
--- a/app-history/navigate/navigate-state-repeated-await.html
+++ b/app-history/navigate/navigate-state-repeated-await.html
@@ -3,11 +3,11 @@
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve());
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve());
- await appHistory.navigate('/foo', {state: {foo: 1}}).committed;
- assert_equals(appHistory.current.getState().foo, 1);
- await appHistory.navigate('/foo', {state: {foo: 2}}).committed;
- assert_equals(appHistory.current.getState().foo, 2);
+ await navigation.navigate('/foo', {state: {foo: 1}}).committed;
+ assert_equals(navigation.currentEntry.getState().foo, 1);
+ await navigation.navigate('/foo', {state: {foo: 2}}).committed;
+ assert_equals(navigation.currentEntry.getState().foo, 2);
}, "navigate() with state should work correctly when called repeatedly - with awaits");
</script>
diff --git a/app-history/navigate/navigate-state-repeated.html b/app-history/navigate/navigate-state-repeated.html
index ed655d2..29c3f68 100644
--- a/app-history/navigate/navigate-state-repeated.html
+++ b/app-history/navigate/navigate-state-repeated.html
@@ -3,16 +3,16 @@
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve());
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve());
- let result1 = appHistory.navigate('/foo', {state: {foo: 1}});
- assert_equals(appHistory.current.getState().foo, 1);
+ let result1 = navigation.navigate('/foo', {state: {foo: 1}});
+ assert_equals(navigation.currentEntry.getState().foo, 1);
// Don't let the harness fail because of the "AbortError" DOMException that is caused by interrupting the navigation.
result1.finished.catch(() => {});
- let result2 = appHistory.navigate('/foo', {state: {foo: 2}});
- assert_equals(appHistory.current.getState().foo, 2);
+ let result2 = navigation.navigate('/foo', {state: {foo: 2}});
+ assert_equals(navigation.currentEntry.getState().foo, 2);
await result1.committed;
await result2.committed;
diff --git a/app-history/navigate/navigate-transitionWhile-history-state.html b/app-history/navigate/navigate-transitionWhile-history-state.html
index 56d9ea1..c5e1036 100644
--- a/app-history/navigate/navigate-transitionWhile-history-state.html
+++ b/app-history/navigate/navigate-transitionWhile-history-state.html
@@ -6,8 +6,8 @@
history.replaceState("state1", "", "#1");
assert_equals(history.state, "state1");
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve("r"));
- await appHistory.navigate("#2").committed;
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve("r"));
+ await navigation.navigate("#2").committed;
assert_equals(location.hash, "#2");
assert_equals(history.state, null);
}, "history.story should be nulled by navigate() handled by transitionWhile()");
diff --git a/app-history/navigate/reload-base-url.html b/app-history/navigate/reload-base-url.html
index 35b29b9..936ad75 100644
--- a/app-history/navigate/reload-base-url.html
+++ b/app-history/navigate/reload-base-url.html
@@ -6,9 +6,9 @@
async_test(t => {
window.onload = t.step_func(() => {
const startingURL = new URL(i.src);
- i.contentWindow.appHistory.reload();
+ i.contentWindow.navigation.reload();
i.onload = t.step_func_done(() => {
- const iframeURL = new URL(i.contentWindow.appHistory.current.url);
+ const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframeURL.pathname, startingURL.pathname);
});
});
diff --git a/app-history/navigate/reload-info.html b/app-history/navigate/reload-info.html
index 412655f..637f697 100644
--- a/app-history/navigate/reload-info.html
+++ b/app-history/navigate/reload-info.html
@@ -7,35 +7,35 @@
window.onload = t.step_func(() => {
const navState = { key: "value" };
const navInfo = { infoKey: "infoValue" };
- i.contentWindow.appHistory.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
+ i.contentWindow.navigation.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
// Make sure that state setting worked
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState);
let start_url = i.contentWindow.location.href;
- let start_key = i.contentWindow.appHistory.current.key;
- let start_id = i.contentWindow.appHistory.current.id;
- let start_state = i.contentWindow.appHistory.current.getState();
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
+ let start_state = i.contentWindow.navigation.currentEntry.getState();
let onnavigate_called = false;
let promise_settled = false;
- i.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func(e => {
onnavigate_called = true;
assert_equals(e.info, navInfo);
assert_equals(e.navigationType, "reload");
assert_equals(e.destination.getState().key, "value");
assert_not_equals(e.destination.getState(), start_state);
});
- i.contentWindow.appHistory.reload({ info: navInfo }).committed.finally(() => {
+ i.contentWindow.navigation.reload({ info: navInfo }).committed.finally(() => {
promise_settled = true;
});
i.onload = t.step_func(() => {
assert_true(onnavigate_called);
assert_equals(i.contentWindow.location.href, start_url);
- assert_equals(i.contentWindow.appHistory.current.key, start_key);
- assert_equals(i.contentWindow.appHistory.current.id, start_id);
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), start_state);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry.key, start_key);
+ assert_equals(i.contentWindow.navigation.currentEntry.id, start_id);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), start_state);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
t.step_timeout(t.step_func_done(() => {
assert_equals(promise_settled, false);
diff --git a/app-history/navigate/reload-navigation-timing.html b/app-history/navigate/reload-navigation-timing.html
index a24e33f..ce03e7a 100644
--- a/app-history/navigate/reload-navigation-timing.html
+++ b/app-history/navigate/reload-navigation-timing.html
@@ -5,7 +5,7 @@
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.reload();
+ i.contentWindow.navigation.reload();
await new Promise(resolve => i.onload = resolve);
const entries = i.contentWindow.performance.getEntriesByType("navigation");
diff --git a/app-history/navigate/reload-no-args.html b/app-history/navigate/reload-no-args.html
index e4f7bd6..c94eae0 100644
--- a/app-history/navigate/reload-no-args.html
+++ b/app-history/navigate/reload-no-args.html
@@ -6,35 +6,35 @@
async_test(t => {
window.onload = t.step_func(() => {
const navState = { key: "value" };
- i.contentWindow.appHistory.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
+ i.contentWindow.navigation.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
// Make sure that state setting worked
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState);
let start_url = i.contentWindow.location.href;
- let start_key = i.contentWindow.appHistory.current.key;
- let start_id = i.contentWindow.appHistory.current.id;
- let start_state = i.contentWindow.appHistory.current.getState();
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
+ let start_state = i.contentWindow.navigation.currentEntry.getState();
let onnavigate_called = false;
let promise_settled = false;
- i.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func(e => {
onnavigate_called = true;
assert_equals(e.info, undefined);
assert_equals(e.navigationType, "reload");
assert_equals(e.destination.getState().key, "value");
assert_not_equals(e.destination.getState(), start_state);
});
- i.contentWindow.appHistory.reload().committed.finally(() => {
+ i.contentWindow.navigation.reload().committed.finally(() => {
promise_settled = true;
});
i.onload = t.step_func(() => {
assert_true(onnavigate_called);
assert_equals(i.contentWindow.location.href, start_url);
- assert_equals(i.contentWindow.appHistory.current.key, start_key);
- assert_equals(i.contentWindow.appHistory.current.id, start_id);
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), start_state);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry.key, start_key);
+ assert_equals(i.contentWindow.navigation.currentEntry.id, start_id);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), start_state);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
t.step_timeout(t.step_func_done(() => {
assert_equals(promise_settled, false);
diff --git a/app-history/navigate/reload-service-worker-fetch-event.html b/app-history/navigate/reload-service-worker-fetch-event.html
index 4d078e4..67535c7 100644
--- a/app-history/navigate/reload-service-worker-fetch-event.html
+++ b/app-history/navigate/reload-service-worker-fetch-event.html
@@ -18,7 +18,7 @@
const frame = await with_iframe(scope);
assert_equals(frame.contentDocument.body.textContent, "method = GET, isReloadNavigation = false");
- frame.contentWindow.appHistory.reload();
+ frame.contentWindow.navigation.reload();
await new Promise(resolve => frame.addEventListener("load", resolve, { once: true }));
assert_equals(frame.contentDocument.body.textContent, "method = GET, isReloadNavigation = true");
diff --git a/app-history/navigate/reload-state-and-info.html b/app-history/navigate/reload-state-and-info.html
index 0811f3d..3ee6a8b 100644
--- a/app-history/navigate/reload-state-and-info.html
+++ b/app-history/navigate/reload-state-and-info.html
@@ -8,17 +8,17 @@
const navState1 = { key: "value" };
const navState2 = { key2: "value2" };
const navInfo = { infoKey: "infoValue" };
- i.contentWindow.appHistory.navigate("#1", { state: navState1 }).committed.then(t.step_func(() => {
+ i.contentWindow.navigation.navigate("#1", { state: navState1 }).committed.then(t.step_func(() => {
// Make sure that state setting worked
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value", "initial state setup");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value", "initial state setup");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState1);
let start_url = i.contentWindow.location.href;
- let start_key = i.contentWindow.appHistory.current.key;
- let start_id = i.contentWindow.appHistory.current.id;
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
let onnavigate_called = false;
let promise_settled = false;
- i.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func(e => {
e.transitionWhile(Promise.resolve());
onnavigate_called = true;
assert_equals(e.info, navInfo);
@@ -26,13 +26,13 @@
assert_equals(e.destination.getState().key2, "value2", "navigate event for the reload()");
assert_not_equals(e.destination.getState(), navState2);
});
- i.contentWindow.appHistory.reload({ info: navInfo, state: navState2 }).committed.then(t.step_func_done(() => {
+ i.contentWindow.navigation.reload({ info: navInfo, state: navState2 }).committed.then(t.step_func_done(() => {
assert_true(onnavigate_called);
assert_equals(i.contentWindow.location.href, start_url);
- assert_equals(i.contentWindow.appHistory.current.key, start_key);
- assert_equals(i.contentWindow.appHistory.current.id, start_id);
- assert_equals(i.contentWindow.appHistory.current.getState().key2, "value2", "current.getState() after teh reload");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState2);
+ assert_equals(i.contentWindow.navigation.currentEntry.key, start_key);
+ assert_equals(i.contentWindow.navigation.currentEntry.id, start_id);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key2, "value2", "current.getState() after teh reload");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState2);
}));
}));
});
diff --git a/app-history/navigate/reload-state-undefined.html b/app-history/navigate/reload-state-undefined.html
index 47b336b..ac204d4 100644
--- a/app-history/navigate/reload-state-undefined.html
+++ b/app-history/navigate/reload-state-undefined.html
@@ -7,17 +7,17 @@
window.onload = t.step_func(() => {
const navState = { key: "value" };
const navInfo = { infoKey: "infoValue" };
- i.contentWindow.appHistory.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
+ i.contentWindow.navigation.navigate("#1", { state: navState }).committed.then(t.step_func(() => {
// Make sure that state setting worked
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState);
let start_url = i.contentWindow.location.href;
- let start_key = i.contentWindow.appHistory.current.key;
- let start_id = i.contentWindow.appHistory.current.id;
+ let start_key = i.contentWindow.navigation.currentEntry.key;
+ let start_id = i.contentWindow.navigation.currentEntry.id;
let onnavigate_called = false;
let promise_settled = false;
- i.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ i.contentWindow.navigation.onnavigate = t.step_func(e => {
e.transitionWhile(Promise.resolve());
onnavigate_called = true;
assert_equals(e.info, navInfo);
@@ -25,13 +25,13 @@
assert_equals(e.destination.getState().key, "value", "destination.getState()");
assert_not_equals(e.destination.getState(), navState);
});
- i.contentWindow.appHistory.reload({ info: navInfo, state: undefined }).committed.then(t.step_func_done(() => {
+ i.contentWindow.navigation.reload({ info: navInfo, state: undefined }).committed.then(t.step_func_done(() => {
assert_true(onnavigate_called);
assert_equals(i.contentWindow.location.href, start_url);
- assert_equals(i.contentWindow.appHistory.current.key, start_key);
- assert_equals(i.contentWindow.appHistory.current.id, start_id);
- assert_equals(i.contentWindow.appHistory.current.getState().key, "value", "destination.getState()");
- assert_not_equals(i.contentWindow.appHistory.current.getState(), navState);
+ assert_equals(i.contentWindow.navigation.currentEntry.key, start_key);
+ assert_equals(i.contentWindow.navigation.currentEntry.id, start_id);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().key, "value", "destination.getState()");
+ assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState);
}));
}));
});
diff --git a/app-history/navigate/return-value/back-already-detached.html b/app-history/navigate/return-value/back-already-detached.html
index dd665e1..f9ff04f 100644
--- a/app-history/navigate/return-value/back-already-detached.html
+++ b/app-history/navigate/return-value/back-already-detached.html
@@ -11,20 +11,20 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
i.remove();
- await assertBothRejectDOM(t, iWindow.appHistory.back(), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.back(), "InvalidStateError", iWindow, iDOMException);
}, "back() in a detached window");
</script>
diff --git a/app-history/navigate/return-value/back-beforeunload.html b/app-history/navigate/return-value/back-beforeunload.html
index 424d353..82c1f58 100644
--- a/app-history/navigate/return-value/back-beforeunload.html
+++ b/app-history/navigate/return-value/back-beforeunload.html
@@ -11,28 +11,28 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.back(), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.back(), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/back-forward-initial-about-blank.html b/app-history/navigate/return-value/back-forward-initial-about-blank.html
index 902090e..dfdb661 100644
--- a/app-history/navigate/return-value/back-forward-initial-about-blank.html
+++ b/app-history/navigate/return-value/back-forward-initial-about-blank.html
@@ -9,9 +9,9 @@
let i = document.createElement("iframe");
document.body.append(i);
- i.contentWindow.appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
// Since there's no way to do a non-replacement navigation on the initial
// about:blank, there's no way to actually get in a situation where we're on
@@ -19,7 +19,7 @@
// list. So this test will almost certainly pass just because there's nothing
// to go back/forward to. Oh well; it's still reasonable coverage.
- await assertBothRejectDOM(t, i.contentWindow.appHistory.back(), "InvalidStateError", i.contentWindow);
- await assertBothRejectDOM(t, i.contentWindow.appHistory.forward(), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.back(), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.forward(), "InvalidStateError", i.contentWindow);
}, "back() and forward() in initial about:blank document");
</script>
diff --git a/app-history/navigate/return-value/back-forward-out-of-bounds.html b/app-history/navigate/return-value/back-forward-out-of-bounds.html
index bef0d7e..015c090 100644
--- a/app-history/navigate/return-value/back-forward-out-of-bounds.html
+++ b/app-history/navigate/return-value/back-forward-out-of-bounds.html
@@ -5,12 +5,12 @@
<script>
promise_test(async t => {
- assert_equals(appHistory.entries().length, 1);
- assert_equals(appHistory.entries()[0], appHistory.current);
- assert_false(appHistory.canGoBack);
- assert_false(appHistory.canGoForward);
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(navigation.entries()[0], navigation.currentEntry);
+ assert_false(navigation.canGoBack);
+ assert_false(navigation.canGoForward);
- await assertBothRejectDOM(t, appHistory.back(), "InvalidStateError");
- await assertBothRejectDOM(t, appHistory.forward(), "InvalidStateError");
+ await assertBothRejectDOM(t, navigation.back(), "InvalidStateError");
+ await assertBothRejectDOM(t, navigation.forward(), "InvalidStateError");
}, "back() and forward() out of bounds");
</script>
diff --git a/app-history/navigate/return-value/back-transitionWhile-rejected.html b/app-history/navigate/return-value/back-transitionWhile-rejected.html
index b617f0b..fc171af 100644
--- a/app-history/navigate/return-value/back-transitionWhile-rejected.html
+++ b/app-history/navigate/return-value/back-transitionWhile-rejected.html
@@ -11,18 +11,18 @@
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
const err = new Error("boo!");
const promise = Promise.reject(err);
promise.catch(() => {}); // prevent unhandled rejection testharness.js errors
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.back();
+ const result = navigation.back();
await assertCommittedFulfillsFinishedRejectsExactly(t, result, entry0, err);
- assert_equals(appHistory.current, entry0);
+ assert_equals(navigation.currentEntry, entry0);
}, "back() promise rejection with rejected transitionWhile()");
</script>
diff --git a/app-history/navigate/return-value/back-transitionWhile.html b/app-history/navigate/return-value/back-transitionWhile.html
index a6680f6..c1161f8 100644
--- a/app-history/navigate/return-value/back-transitionWhile.html
+++ b/app-history/navigate/return-value/back-transitionWhile.html
@@ -11,15 +11,15 @@
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: "def" }));
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: "def" }));
- const result = appHistory.back();
+ const result = navigation.back();
await assertBothFulfill(t, result, entry0);
- assert_equals(appHistory.current, entry0);
+ assert_equals(navigation.currentEntry, entry0);
}, "back() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/return-value/back.html b/app-history/navigate/return-value/back.html
index 1be1d42..a2b13db 100644
--- a/app-history/navigate/return-value/back.html
+++ b/app-history/navigate/return-value/back.html
@@ -11,13 +11,13 @@
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- const result = appHistory.back();
+ const result = navigation.back();
await assertBothFulfill(t, result, entry0);
- assert_equals(appHistory.current, entry0);
+ assert_equals(navigation.currentEntry, entry0);
}, "back() promises");
</script>
diff --git a/app-history/navigate/return-value/forward-already-detached.html b/app-history/navigate/return-value/forward-already-detached.html
index c3b7de8..4dfa74d 100644
--- a/app-history/navigate/return-value/forward-already-detached.html
+++ b/app-history/navigate/return-value/forward-already-detached.html
@@ -11,23 +11,23 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(resolve => i.onload = resolve);
- 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]);
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
i.remove();
- await assertBothRejectDOM(t, iWindow.appHistory.forward(), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.forward(), "InvalidStateError", iWindow, iDOMException);
}, "forward() in a detached window");
</script>
diff --git a/app-history/navigate/return-value/forward-beforeunload.html b/app-history/navigate/return-value/forward-beforeunload.html
index c97b796..87fa4ba 100644
--- a/app-history/navigate/return-value/forward-beforeunload.html
+++ b/app-history/navigate/return-value/forward-beforeunload.html
@@ -11,31 +11,31 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- i.contentWindow.appHistory.back();
+ i.contentWindow.navigation.back();
await new Promise(resolve => i.onload = resolve);
- 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]);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.forward(), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.forward(), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/forward-transitionWhile-rejected.html b/app-history/navigate/return-value/forward-transitionWhile-rejected.html
index 76cbfe4..7ff0c70 100644
--- a/app-history/navigate/return-value/forward-transitionWhile-rejected.html
+++ b/app-history/navigate/return-value/forward-transitionWhile-rejected.html
@@ -10,20 +10,20 @@
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
location.href = "#1";
- await appHistory.back().committed;
+ await navigation.back().committed;
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
const err = new Error("boo!");
const promise = Promise.reject(err);
promise.catch(() => {}); // prevent unhandled rejection testharness.js errors
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.forward();
+ const result = navigation.forward();
await assertCommittedFulfillsFinishedRejectsExactly(t, result, entry1, err);
- assert_equals(appHistory.current, entry1);
+ assert_equals(navigation.currentEntry, entry1);
}, "forward() promise rejection with rejected transitionWhile()");
</script>
diff --git a/app-history/navigate/return-value/forward-transitionWhile.html b/app-history/navigate/return-value/forward-transitionWhile.html
index 86bf547..2b8175b 100644
--- a/app-history/navigate/return-value/forward-transitionWhile.html
+++ b/app-history/navigate/return-value/forward-transitionWhile.html
@@ -11,18 +11,18 @@
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- await appHistory.back().committed;
+ await navigation.back().committed;
const promise = Promise.resolve({ abc: "def" });
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.forward();
+ const result = navigation.forward();
await assertBothFulfill(t, result, entry1);
- assert_equals(appHistory.current, entry1);
+ assert_equals(navigation.currentEntry, entry1);
}, "forward() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/return-value/forward.html b/app-history/navigate/return-value/forward.html
index 15d454c..36bdba8 100644
--- a/app-history/navigate/return-value/forward.html
+++ b/app-history/navigate/return-value/forward.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
location.href = "#1";
- await appHistory.back().committed;
+ await navigation.back().committed;
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- const result = appHistory.forward();
+ const result = navigation.forward();
await assertBothFulfill(t, result, entry1);
- assert_equals(appHistory.current, entry1);
+ assert_equals(navigation.currentEntry, entry1);
}, "forward() promises");
</script>
diff --git a/app-history/navigate/return-value/goTo-already-detached.html b/app-history/navigate/return-value/goTo-already-detached.html
index 9752cbb..b974393 100644
--- a/app-history/navigate/return-value/goTo-already-detached.html
+++ b/app-history/navigate/return-value/goTo-already-detached.html
@@ -11,10 +11,10 @@
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
- const key = iWindow.appHistory.current.key;
+ const key = iWindow.navigation.currentEntry.key;
i.remove();
- await assertBothRejectDOM(t, iWindow.appHistory.goTo(key), "InvalidStateError", iWindow, iDOMException);
-}, "goTo() in a detached window");
+ await assertBothRejectDOM(t, iWindow.navigation.traverseTo(key), "InvalidStateError", iWindow, iDOMException);
+}, "traverseTo() in a detached window");
</script>
diff --git a/app-history/navigate/return-value/goTo-beforeunload.html b/app-history/navigate/return-value/goTo-beforeunload.html
index 2a63ab1..3b27222 100644
--- a/app-history/navigate/return-value/goTo-beforeunload.html
+++ b/app-history/navigate/return-value/goTo-beforeunload.html
@@ -10,22 +10,22 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.goTo(i.contentWindow.appHistory.current.key), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.traverseTo(i.contentWindow.navigation.currentEntry.key), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
assert_equals(navigateEventCount, 1);
-}, "goTo() inside onbeforeunload");
+}, "traverseTo() inside onbeforeunload");
</script>
diff --git a/app-history/navigate/return-value/goTo-cross-document-preventDefault.html b/app-history/navigate/return-value/goTo-cross-document-preventDefault.html
index 9c23017..09c91ee 100644
--- a/app-history/navigate/return-value/goTo-cross-document-preventDefault.html
+++ b/app-history/navigate/return-value/goTo-cross-document-preventDefault.html
@@ -11,19 +11,19 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
// This will be a noop, because navigate events are uncancelable for traversals.
- i.contentWindow.appHistory.onnavigate = e => e.preventDefault();
+ i.contentWindow.navigation.onnavigate = e => e.preventDefault();
- assertNeverSettles(t, i.contentWindow.appHistory.goTo(key), i.contentWindow);
+ assertNeverSettles(t, i.contentWindow.navigation.traverseTo(key), i.contentWindow);
await new Promise(resolve => i.onload = () => t.step_timeout(resolve, 0));
-}, "goTo() promise never settle when preventDefault()ing the navigate event (cross-document)");
+}, "traverseTo() promise never settle when preventDefault()ing the navigate event (cross-document)");
</script>
diff --git a/app-history/navigate/return-value/goTo-current.html b/app-history/navigate/return-value/goTo-current.html
index 0601dbe..212fe99 100644
--- a/app-history/navigate/return-value/goTo-current.html
+++ b/app-history/navigate/return-value/goTo-current.html
@@ -5,13 +5,13 @@
<script>
promise_test(async t => {
- assert_equals(appHistory.entries().length, 1);
- const entry = appHistory.current;
+ assert_equals(navigation.entries().length, 1);
+ const entry = navigation.currentEntry;
- const result = appHistory.goTo(appHistory.current.key);
+ const result = navigation.traverseTo(navigation.currentEntry.key);
await assertBothFulfill(t, result, entry);
- assert_equals(appHistory.entries().length, 1);
- assert_equals(appHistory.current, entry);
-}, "goTo() with current key");
+ assert_equals(navigation.entries().length, 1);
+ assert_equals(navigation.currentEntry, entry);
+}, "traverseTo() with current key");
</script>
diff --git a/app-history/navigate/return-value/goTo-detach-cross-document.html b/app-history/navigate/return-value/goTo-detach-cross-document.html
index 95b2ec8..8784313 100644
--- a/app-history/navigate/return-value/goTo-detach-cross-document.html
+++ b/app-history/navigate/return-value/goTo-detach-cross-document.html
@@ -11,19 +11,19 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => i.onload = resolve);
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
- i.contentWindow.appHistory.onnavigate = () => i.remove();
+ i.contentWindow.navigation.onnavigate = () => i.remove();
- await assertBothRejectDOM(t, i.contentWindow.appHistory.goTo(key), "AbortError", iWindow, iDOMException);
-}, "goTo() promise rejections when detaching an iframe inside onnavigate (cross-document)");
+ await assertBothRejectDOM(t, i.contentWindow.navigation.traverseTo(key), "AbortError", iWindow, iDOMException);
+}, "traverseTo() promise rejections when detaching an iframe inside onnavigate (cross-document)");
</script>
diff --git a/app-history/navigate/return-value/goTo-detach-same-document.html b/app-history/navigate/return-value/goTo-detach-same-document.html
index 441f937..b0308b8 100644
--- a/app-history/navigate/return-value/goTo-detach-same-document.html
+++ b/app-history/navigate/return-value/goTo-detach-same-document.html
@@ -11,18 +11,18 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- let key = i.contentWindow.appHistory.current.key;
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ let key = i.contentWindow.navigation.currentEntry.key;
- await i.contentWindow.appHistory.navigate("#1").committed;
+ await i.contentWindow.navigation.navigate("#1").committed;
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
- i.contentWindow.appHistory.onnavigate = () => i.remove();
+ i.contentWindow.navigation.onnavigate = () => i.remove();
- await assertBothRejectDOM(t, i.contentWindow.appHistory.goTo(key), "AbortError", iWindow, iDOMException);
-}, "goTo() promise rejections when detaching an iframe inside onnavigate (same-document)");
+ await assertBothRejectDOM(t, i.contentWindow.navigation.traverseTo(key), "AbortError", iWindow, iDOMException);
+}, "traverseTo() promise rejections when detaching an iframe inside onnavigate (same-document)");
</script>
diff --git a/app-history/navigate/return-value/goTo-invalid-key.html b/app-history/navigate/return-value/goTo-invalid-key.html
index ee4d66f..42be40b 100644
--- a/app-history/navigate/return-value/goTo-invalid-key.html
+++ b/app-history/navigate/return-value/goTo-invalid-key.html
@@ -5,6 +5,6 @@
<script>
promise_test(async t => {
- await assertBothRejectDOM(t, appHistory.goTo("not a real key"), "InvalidStateError");
-}, "goTo() with invalid key");
+ await assertBothRejectDOM(t, navigation.traverseTo("not a real key"), "InvalidStateError");
+}, "traverseTo() with invalid key");
</script>
diff --git a/app-history/navigate/return-value/goTo-repeated.html b/app-history/navigate/return-value/goTo-repeated.html
index 80d43d6..d1754d6 100644
--- a/app-history/navigate/return-value/goTo-repeated.html
+++ b/app-history/navigate/return-value/goTo-repeated.html
@@ -9,16 +9,16 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const key = appHistory.current.key;
- const entry = appHistory.current;
- await appHistory.navigate("#1").committed;
+ const key = navigation.currentEntry.key;
+ const entry = navigation.currentEntry;
+ await navigation.navigate("#1").committed;
- const result1 = appHistory.goTo(key);
- const result2 = appHistory.goTo(key);
+ const result1 = navigation.traverseTo(key);
+ const result2 = navigation.traverseTo(key);
await assertBothFulfill(t, result1, entry);
assert_not_equals(result1, result2);
assert_equals(result2.committed, result1.committed, "committed promises must be equal");
assert_equals(result2.finished, result1.finished, "finished promises must be equal");
-}, "Repeated appHistory.goTo() with the same key");
+}, "Repeated navigation.traverseTo() with the same key");
</script>
diff --git a/app-history/navigate/return-value/goTo-transitionWhile-rejected.html b/app-history/navigate/return-value/goTo-transitionWhile-rejected.html
index 9e30604..6135310 100644
--- a/app-history/navigate/return-value/goTo-transitionWhile-rejected.html
+++ b/app-history/navigate/return-value/goTo-transitionWhile-rejected.html
@@ -9,22 +9,22 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const key0 = appHistory.current.key;
+ const key0 = navigation.currentEntry.key;
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
const err = new Error("boo!");
const promise = Promise.reject(err);
promise.catch(() => {}); // prevent unhandled rejection testharness.js errors
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.goTo(key0);
+ const result = navigation.traverseTo(key0);
await assertCommittedFulfillsFinishedRejectsExactly(t, result, entry0, err);
- assert_equals(appHistory.current, entry0);
-}, "goTo() promise rejection with rejected transitionWhile()");
+ assert_equals(navigation.currentEntry, entry0);
+}, "traverseTo() promise rejection with rejected transitionWhile()");
</script>
diff --git a/app-history/navigate/return-value/goTo-transitionWhile.html b/app-history/navigate/return-value/goTo-transitionWhile.html
index 4b98a27..430fbe8 100644
--- a/app-history/navigate/return-value/goTo-transitionWhile.html
+++ b/app-history/navigate/return-value/goTo-transitionWhile.html
@@ -9,19 +9,19 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const key0 = appHistory.current.key;
+ const key0 = navigation.currentEntry.key;
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: "def" }));
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: "def" }));
- const result = appHistory.goTo(key0);
+ const result = navigation.traverseTo(key0);
await assertBothFulfill(t, result, entry0);
- assert_equals(appHistory.current, entry0);
-}, "goTo() and transitionWhile() with a fulfilled promise");
+ assert_equals(navigation.currentEntry, entry0);
+}, "traverseTo() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/return-value/goTo.html b/app-history/navigate/return-value/goTo.html
index 81a3ef2..8e00f5b 100644
--- a/app-history/navigate/return-value/goTo.html
+++ b/app-history/navigate/return-value/goTo.html
@@ -9,17 +9,17 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const key0 = appHistory.current.key;
+ const key0 = navigation.currentEntry.key;
location.href = "#1";
- assert_equals(appHistory.entries().length, 2);
- const [entry0, entry1] = appHistory.entries();
+ assert_equals(navigation.entries().length, 2);
+ const [entry0, entry1] = navigation.entries();
assert_equals((new URL(entry0.url)).hash, "");
assert_equals((new URL(entry1.url)).hash, "#1");
- const result = appHistory.goTo(key0);
+ const result = navigation.traverseTo(key0);
await assertBothFulfill(t, result, entry0);
- assert_equals(appHistory.current, entry0);
-}, "goTo() promises");
+ assert_equals(navigation.currentEntry, entry0);
+}, "traverseTo() promises");
</script>
diff --git a/app-history/navigate/return-value/navigate-already-detached.html b/app-history/navigate/return-value/navigate-already-detached.html
index cc077e2..33cdd69 100644
--- a/app-history/navigate/return-value/navigate-already-detached.html
+++ b/app-history/navigate/return-value/navigate-already-detached.html
@@ -14,6 +14,6 @@
i.remove();
- await assertBothRejectDOM(t, iWindow.appHistory.navigate("?1"), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.navigate("?1"), "InvalidStateError", iWindow, iDOMException);
}, "navigate() in a detached window");
</script>
diff --git a/app-history/navigate/return-value/navigate-beforeunload.html b/app-history/navigate/return-value/navigate-beforeunload.html
index 2c9af27..f0a9069 100644
--- a/app-history/navigate/return-value/navigate-beforeunload.html
+++ b/app-history/navigate/return-value/navigate-beforeunload.html
@@ -10,18 +10,18 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("#"), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.navigate("#"), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/navigate-cross-document.html b/app-history/navigate/return-value/navigate-cross-document.html
index 0735a23..b83b1e9 100644
--- a/app-history/navigate/return-value/navigate-cross-document.html
+++ b/app-history/navigate/return-value/navigate-cross-document.html
@@ -8,7 +8,7 @@
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- const result = i.contentWindow.appHistory.navigate("?1");
+ const result = i.contentWindow.navigation.navigate("?1");
assertNeverSettles(t, result, i.contentWindow);
await new Promise(resolve => i.onload = () => t.step_timeout(resolve, 0));
diff --git a/app-history/navigate/return-value/navigate-detach.html b/app-history/navigate/return-value/navigate-detach.html
index 84b1d2c..0e80e1b 100644
--- a/app-history/navigate/return-value/navigate-detach.html
+++ b/app-history/navigate/return-value/navigate-detach.html
@@ -11,8 +11,8 @@
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
- i.contentWindow.appHistory.onnavigate = () => i.remove();
+ i.contentWindow.navigation.onnavigate = () => i.remove();
- await assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("#1"), "AbortError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.navigate("#1"), "AbortError", iWindow, iDOMException);
}, "navigate() promise rejections when detaching an iframe inside onnavigate");
</script>
diff --git a/app-history/navigate/return-value/navigate-file-url.html b/app-history/navigate/return-value/navigate-file-url.html
index 1dc3835..138f6ff 100644
--- a/app-history/navigate/return-value/navigate-file-url.html
+++ b/app-history/navigate/return-value/navigate-file-url.html
@@ -5,6 +5,6 @@
<script>
promise_test(async t => {
- await assertBothRejectDOM(t, appHistory.navigate("file://"), "AbortError");
+ await assertBothRejectDOM(t, navigation.navigate("file://"), "AbortError");
}, "navigate() to a file: URL");
</script>
diff --git a/app-history/navigate/return-value/navigate-initial-about-blank-cross-document.html b/app-history/navigate/return-value/navigate-initial-about-blank-cross-document.html
index d70890a..8ec76b1 100644
--- a/app-history/navigate/return-value/navigate-initial-about-blank-cross-document.html
+++ b/app-history/navigate/return-value/navigate-initial-about-blank-cross-document.html
@@ -9,12 +9,12 @@
let i = document.createElement("iframe");
document.body.append(i);
- i.contentWindow.appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
// Cannot just use "/common/blank.html?1" since it doesn't resolve relative to about:blank.
- const result = i.contentWindow.appHistory.navigate(new URL("/common/blank.html?1", location.href).href);
+ const result = i.contentWindow.navigation.navigate(new URL("/common/blank.html?1", location.href).href);
assertNeverSettles(t, result, i.contentWindow);
await new Promise(resolve => t.step_timeout(resolve, 10));
}, "navigate() in initial about:blank document (cross-document)");
diff --git a/app-history/navigate/return-value/navigate-initial-about-blank.html b/app-history/navigate/return-value/navigate-initial-about-blank.html
index 6c97603..9734a09 100644
--- a/app-history/navigate/return-value/navigate-initial-about-blank.html
+++ b/app-history/navigate/return-value/navigate-initial-about-blank.html
@@ -9,11 +9,11 @@
let i = document.createElement("iframe");
document.body.append(i);
- i.contentWindow.appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- const result = i.contentWindow.appHistory.navigate("#1");
+ const result = i.contentWindow.navigation.navigate("#1");
assertNeverSettles(t, result, i.contentWindow);
await new Promise(resolve => t.step_timeout(resolve, 10));
}, "navigate() in initial about:blank document");
diff --git a/app-history/navigate/return-value/navigate-interrupted-within-onnavigate.html b/app-history/navigate/return-value/navigate-interrupted-within-onnavigate.html
index cfd3e13..3db02c6 100644
--- a/app-history/navigate/return-value/navigate-interrupted-within-onnavigate.html
+++ b/app-history/navigate/return-value/navigate-interrupted-within-onnavigate.html
@@ -10,19 +10,19 @@
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
let result2;
- appHistory.onnavigate = t.step_func(e => {
+ navigation.onnavigate = t.step_func(e => {
if (e.info == 1) {
- result2 = appHistory.navigate("#2", { info: 2 });
+ result2 = navigation.navigate("#2", { info: 2 });
assert_true(e.defaultPrevented);
}
});
- const result1 = appHistory.navigate("#1", { info: 1 });
+ const result1 = navigation.navigate("#1", { info: 1 });
- assert_equals(appHistory.entries().length, 2);
- assert_array_equals(appHistory.entries().map(e => (new URL(e.url)).hash), ["", "#2"]);
+ assert_equals(navigation.entries().length, 2);
+ assert_array_equals(navigation.entries().map(e => (new URL(e.url)).hash), ["", "#2"]);
await assertBothRejectDOM(t, result1, "AbortError");
- await assertBothFulfill(t, result2, appHistory.current);
+ await assertBothFulfill(t, result2, navigation.currentEntry);
}, "if navigate() is called inside onnavigate, the previous navigation and navigate event are cancelled");
</script>
diff --git a/app-history/navigate/return-value/navigate-interrupted.html b/app-history/navigate/return-value/navigate-interrupted.html
index 0d419c0..2c92825 100644
--- a/app-history/navigate/return-value/navigate-interrupted.html
+++ b/app-history/navigate/return-value/navigate-interrupted.html
@@ -9,13 +9,13 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const result1 = appHistory.navigate("#1");
- const result2 = appHistory.navigate("#2");
+ const result1 = navigation.navigate("#1");
+ const result2 = navigation.navigate("#2");
- assert_equals(appHistory.entries().length, 3);
- assert_array_equals(appHistory.entries().map(e => (new URL(e.url)).hash), ["", "#1", "#2"]);
+ assert_equals(navigation.entries().length, 3);
+ assert_array_equals(navigation.entries().map(e => (new URL(e.url)).hash), ["", "#1", "#2"]);
- await assertCommittedFulfillsFinishedRejectsDOM(t, result1, appHistory.entries()[1], "AbortError");
- await assertBothFulfill(t, result2, appHistory.current);
+ await assertCommittedFulfillsFinishedRejectsDOM(t, result1, navigation.entries()[1], "AbortError");
+ await assertBothFulfill(t, result2, navigation.currentEntry);
}, "interrupted navigate() promises");
</script>
diff --git a/app-history/navigate/return-value/navigate-invalid-url.html b/app-history/navigate/return-value/navigate-invalid-url.html
index a9d47d0..5b5b442 100644
--- a/app-history/navigate/return-value/navigate-invalid-url.html
+++ b/app-history/navigate/return-value/navigate-invalid-url.html
@@ -5,6 +5,6 @@
<script>
promise_test(async t => {
- await assertBothRejectDOM(t, appHistory.navigate("https://example.com\u0000mozilla.org"), "SyntaxError");
+ await assertBothRejectDOM(t, navigation.navigate("https://example.com\u0000mozilla.org"), "SyntaxError");
}, "navigate() with an invalid URL");
</script>
diff --git a/app-history/navigate/return-value/navigate-preventDefault.html b/app-history/navigate/return-value/navigate-preventDefault.html
index e27bde7..6257c5a 100644
--- a/app-history/navigate/return-value/navigate-preventDefault.html
+++ b/app-history/navigate/return-value/navigate-preventDefault.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.preventDefault();
+ navigation.onnavigate = e => e.preventDefault();
- await assertBothRejectDOM(t, appHistory.navigate("#"), "AbortError");
+ await assertBothRejectDOM(t, navigation.navigate("#"), "AbortError");
}, "navigate() when the onnavigate handler calls preventDefault()");
</script>
diff --git a/app-history/navigate/return-value/navigate-rejection-order-beforeunload-unserializablestate.html b/app-history/navigate/return-value/navigate-rejection-order-beforeunload-unserializablestate.html
index b700570..3039c92 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-beforeunload-unserializablestate.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-beforeunload-unserializablestate.html
@@ -10,18 +10,18 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func('onnavigatesuccess should not be called');
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func('onnavigateerror should not be called');
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func('onnavigatesuccess should not be called');
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func('onnavigateerror should not be called');
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("/common/blank.html?1", { state: document.body }), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.navigate("/common/blank.html?1", { state: document.body }), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/navigate-rejection-order-detached-unserializablestate.html b/app-history/navigate/return-value/navigate-rejection-order-detached-unserializablestate.html
index 69fe452..f14df84 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-detached-unserializablestate.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-detached-unserializablestate.html
@@ -13,8 +13,8 @@
i.remove();
- iWindow.appHistory.onnavigate = t.unreached_func("onnavigate");
+ iWindow.navigation.onnavigate = t.unreached_func("onnavigate");
- await assertBothRejectDOM(t, iWindow.appHistory.navigate("https://example.com/", { state: document.body }), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.navigate("https://example.com/", { state: document.body }), "InvalidStateError", iWindow, iDOMException);
}, `navigate() with unserializable state in a detached iframe throws "InvalidStateError", not "DataCloneError"`);
</script>
diff --git a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-beforeunload.html b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-beforeunload.html
index 5346ecd..4873e85 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-beforeunload.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-beforeunload.html
@@ -10,18 +10,18 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-detached.html b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-detached.html
index bd7981d..2250a54 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-detached.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-detached.html
@@ -13,8 +13,8 @@
i.remove();
- iWindow.appHistory.onnavigate = t.unreached_func("onnavigate");
+ iWindow.navigation.onnavigate = t.unreached_func("onnavigate");
- await assertBothRejectDOM(t, iWindow.appHistory.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", iWindow, iDOMException);
}, `navigate() with an invalid URL in a detached iframe throws "SyntaxError", not "InvalidStateError"`);
</script>
diff --git a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unload.html b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unload.html
index 8cf6c01..d778dd6 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unload.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unload.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => {
i.contentWindow.onunload = t.step_func(async () => {
- await assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.navigate("https://example.com\u0000mozilla.org"), "SyntaxError", i.contentWindow);
assert_equals(navigateEventCount, 1);
resolve();
});
diff --git a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unserializablestate.html b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unserializablestate.html
index f1ccb0c..07e194c 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unserializablestate.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-invalidurl-unserializablestate.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = t.unreached_func("onnavigate");
+ navigation.onnavigate = t.unreached_func("onnavigate");
- await assertBothRejectDOM(t, appHistory.navigate("https://example.com\u0000mozilla.org", { state: document.body }), "SyntaxError");
+ await assertBothRejectDOM(t, navigation.navigate("https://example.com\u0000mozilla.org", { state: document.body }), "SyntaxError");
}, `navigate() with an invalid URL and unserializable state throws "SyntaxError", not "DataCloneError"`);
</script>
diff --git a/app-history/navigate/return-value/navigate-rejection-order-unload-unserializablestate.html b/app-history/navigate/return-value/navigate-rejection-order-unload-unserializablestate.html
index ac79760..287434a 100644
--- a/app-history/navigate/return-value/navigate-rejection-order-unload-unserializablestate.html
+++ b/app-history/navigate/return-value/navigate-rejection-order-unload-unserializablestate.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => {
i.contentWindow.onunload = t.step_func(async () => {
- await assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("?2", { state: document.body }), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.navigate("?2", { state: document.body }), "InvalidStateError", i.contentWindow);
assert_equals(navigateEventCount, 1);
resolve();
});
diff --git a/app-history/navigate/return-value/navigate-transitionWhile-interrupted.html b/app-history/navigate/return-value/navigate-transitionWhile-interrupted.html
index 0e274d5..fa818b4 100644
--- a/app-history/navigate/return-value/navigate-transitionWhile-interrupted.html
+++ b/app-history/navigate/return-value/navigate-transitionWhile-interrupted.html
@@ -9,15 +9,15 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- appHistory.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
+ navigation.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
- const result1 = appHistory.navigate("#1");
- const result2 = appHistory.navigate("#2");
+ const result1 = navigation.navigate("#1");
+ const result2 = navigation.navigate("#2");
- assert_equals(appHistory.entries().length, 3);
- assert_array_equals(appHistory.entries().map(e => (new URL(e.url)).hash), ["", "#1", "#2"]);
+ assert_equals(navigation.entries().length, 3);
+ assert_array_equals(navigation.entries().map(e => (new URL(e.url)).hash), ["", "#1", "#2"]);
- await assertCommittedFulfillsFinishedRejectsDOM(t, result1, appHistory.entries()[1], "AbortError");
- await assertBothFulfill(t, result2, appHistory.current);
+ await assertCommittedFulfillsFinishedRejectsDOM(t, result1, navigation.entries()[1], "AbortError");
+ await assertBothFulfill(t, result2, navigation.currentEntry);
}, "interrupted navigate() promises with transitionWhile()");
</script>
diff --git a/app-history/navigate/return-value/navigate-transitionWhile-rejected.html b/app-history/navigate/return-value/navigate-transitionWhile-rejected.html
index 36d9569..c1d4c49 100644
--- a/app-history/navigate/return-value/navigate-transitionWhile-rejected.html
+++ b/app-history/navigate/return-value/navigate-transitionWhile-rejected.html
@@ -8,10 +8,10 @@
const err = new Error("boo!");
const promise = Promise.reject(err);
promise.catch(() => {}); // prevent unhandled rejection testharness.js errors
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
- await assertCommittedFulfillsFinishedRejectsExactly(t, result, appHistory.current, err);
+ await assertCommittedFulfillsFinishedRejectsExactly(t, result, navigation.currentEntry, err);
}, "navigate() and transitionWhile() with a rejected promise");
</script>
diff --git a/app-history/navigate/return-value/navigate-transitionWhile.html b/app-history/navigate/return-value/navigate-transitionWhile.html
index 7809be1..2fe78e5 100644
--- a/app-history/navigate/return-value/navigate-transitionWhile.html
+++ b/app-history/navigate/return-value/navigate-transitionWhile.html
@@ -5,11 +5,11 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: 'def' }));
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: 'def' }));
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
- await assertBothFulfill(t, result, appHistory.current);
- assert_equals((new URL(appHistory.current.url)).hash, "#1");
+ await assertBothFulfill(t, result, navigation.currentEntry);
+ assert_equals((new URL(navigation.currentEntry.url)).hash, "#1");
}, "navigate() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/return-value/navigate-unload.html b/app-history/navigate/return-value/navigate-unload.html
index 641de2c..fbc1fde 100644
--- a/app-history/navigate/return-value/navigate-unload.html
+++ b/app-history/navigate/return-value/navigate-unload.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => {
i.contentWindow.onunload = t.step_func(async () => {
- await assertBothRejectDOM(t, i.contentWindow.appHistory.navigate("?2"), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.navigate("?2"), "InvalidStateError", i.contentWindow);
assert_equals(navigateEventCount, 1);
resolve();
});
diff --git a/app-history/navigate/return-value/navigate-unserializable-state.html b/app-history/navigate/return-value/navigate-unserializable-state.html
index e6060ce..36464ec 100644
--- a/app-history/navigate/return-value/navigate-unserializable-state.html
+++ b/app-history/navigate/return-value/navigate-unserializable-state.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- await assertBothRejectDOM(t, appHistory.navigate("#1", { state: new WritableStream() }), "DataCloneError");
- assert_equals(appHistory.current.getState(), undefined);
+ await assertBothRejectDOM(t, navigation.navigate("#1", { state: new WritableStream() }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
assert_equals(location.hash, "");
}, "navigate() with an unserializable state (WritableStream)");
@@ -14,8 +14,8 @@
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
const buffer = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
- await assertBothRejectDOM(t, appHistory.navigate("#2", { state: buffer }), "DataCloneError");
- assert_equals(appHistory.current.getState(), undefined);
+ await assertBothRejectDOM(t, navigation.navigate("#2", { state: buffer }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
assert_equals(location.hash, "");
}, "navigate() with an unserializable state (SharedArrayBuffer)");
</script>
diff --git a/app-history/navigate/return-value/navigate.html b/app-history/navigate/return-value/navigate.html
index eab1e8a..34ff84f 100644
--- a/app-history/navigate/return-value/navigate.html
+++ b/app-history/navigate/return-value/navigate.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- const result = appHistory.navigate("#1");
- await assertBothFulfill(t, result, appHistory.current);
- assert_equals((new URL(appHistory.current.url)).hash, "#1");
+ const result = navigation.navigate("#1");
+ await assertBothFulfill(t, result, navigation.currentEntry);
+ assert_equals((new URL(navigation.currentEntry.url)).hash, "#1");
}, "navigate() promises");
</script>
diff --git a/app-history/navigate/return-value/reload-already-detached.html b/app-history/navigate/return-value/reload-already-detached.html
index 7ecd31a..9b0780c 100644
--- a/app-history/navigate/return-value/reload-already-detached.html
+++ b/app-history/navigate/return-value/reload-already-detached.html
@@ -14,6 +14,6 @@
i.remove();
- await assertBothRejectDOM(t, iWindow.appHistory.reload(), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.reload(), "InvalidStateError", iWindow, iDOMException);
}, "reload() in a detached window");
</script>
diff --git a/app-history/navigate/return-value/reload-beforeunload.html b/app-history/navigate/return-value/reload-beforeunload.html
index 7a3d9e3..05338ac 100644
--- a/app-history/navigate/return-value/reload-beforeunload.html
+++ b/app-history/navigate/return-value/reload-beforeunload.html
@@ -10,18 +10,18 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.reload(), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.reload(), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/reload-detach.html b/app-history/navigate/return-value/reload-detach.html
index f5b9991..621bb59 100644
--- a/app-history/navigate/return-value/reload-detach.html
+++ b/app-history/navigate/return-value/reload-detach.html
@@ -11,8 +11,8 @@
const iWindow = i.contentWindow;
const iDOMException = iWindow.DOMException;
- i.contentWindow.appHistory.onnavigate = () => i.remove();
+ i.contentWindow.navigation.onnavigate = () => i.remove();
- await assertBothRejectDOM(t, i.contentWindow.appHistory.reload(), "AbortError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.reload(), "AbortError", iWindow, iDOMException);
}, "reload() promise rejections when detaching an iframe inside onnavigate");
</script>
diff --git a/app-history/navigate/return-value/reload-initial-about-blank.html b/app-history/navigate/return-value/reload-initial-about-blank.html
index e1b9f14..9e717fe 100644
--- a/app-history/navigate/return-value/reload-initial-about-blank.html
+++ b/app-history/navigate/return-value/reload-initial-about-blank.html
@@ -9,11 +9,11 @@
let i = document.createElement("iframe");
document.body.append(i);
- i.contentWindow.appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- const result = i.contentWindow.appHistory.reload();
+ const result = i.contentWindow.navigation.reload();
assertNeverSettles(t, result, i.contentWindow);
await new Promise(resolve => t.step_timeout(resolve, 10));
}, "reload() in initial about:blank document");
diff --git a/app-history/navigate/return-value/reload-preventDefault.html b/app-history/navigate/return-value/reload-preventDefault.html
index 3eeb72f..747044b 100644
--- a/app-history/navigate/return-value/reload-preventDefault.html
+++ b/app-history/navigate/return-value/reload-preventDefault.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.preventDefault();
+ navigation.onnavigate = e => e.preventDefault();
- await assertBothRejectDOM(t, appHistory.reload(), "AbortError");
+ await assertBothRejectDOM(t, navigation.reload(), "AbortError");
}, "reload() when the onnavigate handler calls preventDefault()");
</script>
diff --git a/app-history/navigate/return-value/reload-rejection-order-beforeunload-unserializablestate.html b/app-history/navigate/return-value/reload-rejection-order-beforeunload-unserializablestate.html
index 89c6047..127f05f 100644
--- a/app-history/navigate/return-value/reload-rejection-order-beforeunload-unserializablestate.html
+++ b/app-history/navigate/return-value/reload-rejection-order-beforeunload-unserializablestate.html
@@ -10,18 +10,18 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func('onnavigatesuccess should not be called');
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func('onnavigateerror should not be called');
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func('onnavigatesuccess should not be called');
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func('onnavigateerror should not be called');
let assertionPromise;
// The iframe does not have sticky activation, so per
// https://html.spec.whatwg.org/#prompt-to-unload-a-document, no prompt is
// shown and the navigation will proceed.
i.contentWindow.onbeforeunload = t.step_func(() => {
- assertionPromise = assertBothRejectDOM(t, i.contentWindow.appHistory.reload({ state: document.body }), "InvalidStateError", i.contentWindow);
+ assertionPromise = assertBothRejectDOM(t, i.contentWindow.navigation.reload({ state: document.body }), "InvalidStateError", i.contentWindow);
});
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
assert_not_equals(assertionPromise, undefined);
await assertionPromise;
diff --git a/app-history/navigate/return-value/reload-rejection-order-detached-unserializablestate.html b/app-history/navigate/return-value/reload-rejection-order-detached-unserializablestate.html
index 12e5ac2..0e00510 100644
--- a/app-history/navigate/return-value/reload-rejection-order-detached-unserializablestate.html
+++ b/app-history/navigate/return-value/reload-rejection-order-detached-unserializablestate.html
@@ -13,8 +13,8 @@
i.remove();
- iWindow.appHistory.onnavigate = t.unreached_func("onnavigate");
+ iWindow.navigation.onnavigate = t.unreached_func("onnavigate");
- await assertBothRejectDOM(t, iWindow.appHistory.reload({ state: document.body }), "InvalidStateError", iWindow, iDOMException);
+ await assertBothRejectDOM(t, iWindow.navigation.reload({ state: document.body }), "InvalidStateError", iWindow, iDOMException);
}, `reload() with unserializable state in a detached iframe throws "InvalidStateError", not "DataCloneError"`);
</script>
diff --git a/app-history/navigate/return-value/reload-rejection-order-unload-unserializablestate.html b/app-history/navigate/return-value/reload-rejection-order-unload-unserializablestate.html
index f528a68..85f69ef 100644
--- a/app-history/navigate/return-value/reload-rejection-order-unload-unserializablestate.html
+++ b/app-history/navigate/return-value/reload-rejection-order-unload-unserializablestate.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => {
i.contentWindow.onunload = t.step_func(async () => {
- await assertBothRejectDOM(t, i.contentWindow.appHistory.reload({ state: document.body }), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.reload({ state: document.body }), "InvalidStateError", i.contentWindow);
assert_equals(navigateEventCount, 1);
resolve();
});
diff --git a/app-history/navigate/return-value/reload-transitionWhile-rejected.html b/app-history/navigate/return-value/reload-transitionWhile-rejected.html
index 6ad452e..e6ec928 100644
--- a/app-history/navigate/return-value/reload-transitionWhile-rejected.html
+++ b/app-history/navigate/return-value/reload-transitionWhile-rejected.html
@@ -8,10 +8,10 @@
const err = new Error("boo!");
const promise = Promise.reject(err);
promise.catch(() => {}); // prevent unhandled rejection testharness.js errors
- appHistory.onnavigate = e => e.transitionWhile(promise);
+ navigation.onnavigate = e => e.transitionWhile(promise);
- const result = appHistory.reload();
+ const result = navigation.reload();
- await assertCommittedFulfillsFinishedRejectsExactly(t, result, appHistory.current, err);
+ await assertCommittedFulfillsFinishedRejectsExactly(t, result, navigation.currentEntry, err);
}, "reload() and transitionWhile() with a rejected promise");
</script>
diff --git a/app-history/navigate/return-value/reload-transitionWhile.html b/app-history/navigate/return-value/reload-transitionWhile.html
index d5563d9..19cea8a 100644
--- a/app-history/navigate/return-value/reload-transitionWhile.html
+++ b/app-history/navigate/return-value/reload-transitionWhile.html
@@ -5,10 +5,10 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: 'def' }));
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve({ abc: 'def' }));
- const result = appHistory.reload();
+ const result = navigation.reload();
- await assertBothFulfill(t, result, appHistory.current);
+ await assertBothFulfill(t, result, navigation.currentEntry);
}, "reload() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/return-value/reload-unload.html b/app-history/navigate/return-value/reload-unload.html
index a62796b..1906659 100644
--- a/app-history/navigate/return-value/reload-unload.html
+++ b/app-history/navigate/return-value/reload-unload.html
@@ -10,15 +10,15 @@
await new Promise(resolve => window.onload = resolve);
let navigateEventCount = 0;
- i.contentWindow.appHistory.onnavigate = () => navigateEventCount++;
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ i.contentWindow.navigation.onnavigate = () => navigateEventCount++;
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
await new Promise(resolve => {
i.contentWindow.onunload = t.step_func(async () => {
- await assertBothRejectDOM(t, i.contentWindow.appHistory.reload(), "InvalidStateError", i.contentWindow);
+ await assertBothRejectDOM(t, i.contentWindow.navigation.reload(), "InvalidStateError", i.contentWindow);
assert_equals(navigateEventCount, 1);
resolve();
});
diff --git a/app-history/navigate/return-value/reload-unserializable-state.html b/app-history/navigate/return-value/reload-unserializable-state.html
index e87071b..76fa870 100644
--- a/app-history/navigate/return-value/reload-unserializable-state.html
+++ b/app-history/navigate/return-value/reload-unserializable-state.html
@@ -5,8 +5,8 @@
<script>
promise_test(async t => {
- await assertBothRejectDOM(t, appHistory.reload({ state: new WritableStream() }), "DataCloneError");
- assert_equals(appHistory.current.getState(), undefined);
+ await assertBothRejectDOM(t, navigation.reload({ state: new WritableStream() }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
assert_equals(location.hash, "");
}, "reload() with an unserializable state (WritableStream)");
@@ -14,8 +14,8 @@
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
const buffer = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
- await assertBothRejectDOM(t, appHistory.reload({ state: buffer }), "DataCloneError");
- assert_equals(appHistory.current.getState(), undefined);
+ await assertBothRejectDOM(t, navigation.reload({ state: buffer }), "DataCloneError");
+ assert_equals(navigation.currentEntry.getState(), undefined);
assert_equals(location.hash, "");
}, "reload() with an unserializable state (SharedArrayBuffer)");
</script>
diff --git a/app-history/navigate/return-value/reload.html b/app-history/navigate/return-value/reload.html
index 55836e7..028d585 100644
--- a/app-history/navigate/return-value/reload.html
+++ b/app-history/navigate/return-value/reload.html
@@ -8,7 +8,7 @@
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
- const result = i.contentWindow.appHistory.reload();
+ const result = i.contentWindow.navigation.reload();
assertNeverSettles(t, result, i.contentWindow);
await new Promise(resolve => i.onload = () => t.step_timeout(resolve, 0));
diff --git a/app-history/navigate/return-value/resources/back-forward-opaque-origin-page.html b/app-history/navigate/return-value/resources/back-forward-opaque-origin-page.html
index 6cdf0a8..ec63363 100644
--- a/app-history/navigate/return-value/resources/back-forward-opaque-origin-page.html
+++ b/app-history/navigate/return-value/resources/back-forward-opaque-origin-page.html
@@ -9,9 +9,9 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
location.hash = "#1";
await new Promise(resolve => window.onhashchange = resolve);
@@ -22,7 +22,7 @@
assert_equals(location.hash, "#1");
- await assertBothRejectDOM(t, appHistory.back(), "InvalidStateError");
- await assertBothRejectDOM(t, appHistory.forward(), "InvalidStateError");
-}, "appHistory.back()/forward() in an opaque origin iframe");
+ await assertBothRejectDOM(t, navigation.back(), "InvalidStateError");
+ await assertBothRejectDOM(t, navigation.forward(), "InvalidStateError");
+}, "navigation.back()/forward() in an opaque origin iframe");
</script>
diff --git a/app-history/navigate/return-value/resources/navigate-opaque-origin-page.html b/app-history/navigate/return-value/resources/navigate-opaque-origin-page.html
index 3802587..831eefd 100644
--- a/app-history/navigate/return-value/resources/navigate-opaque-origin-page.html
+++ b/app-history/navigate/return-value/resources/navigate-opaque-origin-page.html
@@ -5,12 +5,12 @@
<script>
promise_test(async t => {
- appHistory.onnavigate = t.unreached_func("onnavigate should not be called");
- appHistory.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
- appHistory.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
+ navigation.onnavigate = t.unreached_func("onnavigate should not be called");
+ navigation.onnavigatesuccess = t.unreached_func("onnavigatesuccess should not be called");
+ navigation.onnavigateerror = t.unreached_func("onnavigateerror should not be called");
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
assertNeverSettles(t, result);
await new Promise(resolve => t.step_timeout(resolve, 10));
-}, "appHistory.navigate() in an opaque origin iframe");
+}, "navigation.navigate() in an opaque origin iframe");
</script>
diff --git a/app-history/navigate/state/navigate-state-after-history-pushState.html b/app-history/navigate/state/navigate-state-after-history-pushState.html
index e24fc0f..1c8858c 100644
--- a/app-history/navigate/state/navigate-state-after-history-pushState.html
+++ b/app-history/navigate/state/navigate-state-after-history-pushState.html
@@ -3,9 +3,9 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(appHistory.current.getState().data, "value");
+ navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(navigation.currentEntry.getState().data, "value");
history.pushState(1, "", "#push");
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
}, "appHistoryEntry.getState() after history.pushState()");
</script>
diff --git a/app-history/navigate/state/navigate-state-after-history-replaceState.html b/app-history/navigate/state/navigate-state-after-history-replaceState.html
index 23f037e..cc37949 100644
--- a/app-history/navigate/state/navigate-state-after-history-replaceState.html
+++ b/app-history/navigate/state/navigate-state-after-history-replaceState.html
@@ -3,9 +3,9 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(appHistory.current.getState().data, "value");
+ navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(navigation.currentEntry.getState().data, "value");
history.replaceState(1, "", "#replace");
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
}, "appHistoryEntry.getState() after history.replaceState()");
</script>
diff --git a/app-history/navigate/state/navigate-state-after-reload.html b/app-history/navigate/state/navigate-state-after-reload.html
index 28b2424..94d4664 100644
--- a/app-history/navigate/state/navigate-state-after-reload.html
+++ b/app-history/navigate/state/navigate-state-after-reload.html
@@ -5,14 +5,14 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
i.contentWindow.location.reload();
i.onload = t.step_func_done(() => {
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
});
});
}, "appHistoryEntry.getState() after location.reload()");
diff --git a/app-history/navigate/state/navigate-state-after-same-document-location-api-navigation.html b/app-history/navigate/state/navigate-state-after-same-document-location-api-navigation.html
index 49e4507..4214226 100644
--- a/app-history/navigate/state/navigate-state-after-same-document-location-api-navigation.html
+++ b/app-history/navigate/state/navigate-state-after-same-document-location-api-navigation.html
@@ -6,19 +6,19 @@
// Wait for after the load event so that the navigation doesn't get converted
// into a replace navigation.
window.onload = () => t.step_timeout(async () => {
- let entry0 = appHistory.current;
+ let entry0 = navigation.currentEntry;
let navState = { statevar: "state" };
- await appHistory.navigate("#1", { state: navState });
- let entry1 = appHistory.current;
+ await navigation.navigate("#1", { state: navState });
+ let entry1 = navigation.currentEntry;
location.href = "#2";
- let entry2 = appHistory.current;
+ let entry2 = navigation.currentEntry;
- assert_equals(appHistory.entries().length, 3);
- assert_equals(entry0, appHistory.entries()[0]);
- assert_equals(entry1, appHistory.entries()[1]);
- assert_equals(entry2, appHistory.entries()[2]);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(entry0, navigation.entries()[0]);
+ assert_equals(entry1, navigation.entries()[1]);
+ assert_equals(entry2, navigation.entries()[2]);
assert_equals(entry0.getState(), undefined);
@@ -34,9 +34,9 @@
history.back();
window.onpopstate = t.step_func_done(() => {
- assert_equals(appHistory.entries().length, 3);
- let back_entry = appHistory.current;
- assert_equals(back_entry, appHistory.entries()[1]);
+ assert_equals(navigation.entries().length, 3);
+ let back_entry = navigation.currentEntry;
+ assert_equals(back_entry, navigation.entries()[1]);
let back_state = back_entry.getState();
assert_not_equals(back_state, state1);
assert_not_equals(back_state, state2);
diff --git a/app-history/navigate/state/navigate-state-after-same-document-navigation.html b/app-history/navigate/state/navigate-state-after-same-document-navigation.html
index e2c1471..73fcf6a 100644
--- a/app-history/navigate/state/navigate-state-after-same-document-navigation.html
+++ b/app-history/navigate/state/navigate-state-after-same-document-navigation.html
@@ -6,21 +6,21 @@
// Wait for after the load event so that the navigation doesn't get converted
// into a replace navigation.
window.onload = () => t.step_timeout(async () => {
- let entry0 = appHistory.current;
+ let entry0 = navigation.currentEntry;
let navState = { statevar: "state" };
- await appHistory.navigate("#1", { state: navState }).committed;
- let entry1 = appHistory.current;
+ await navigation.navigate("#1", { state: navState }).committed;
+ let entry1 = navigation.currentEntry;
navState.startvar2 = "otherstate";
- await appHistory.navigate("#2", { state: navState }).committed;
- let entry2 = appHistory.current;
+ await navigation.navigate("#2", { state: navState }).committed;
+ let entry2 = navigation.currentEntry;
t.step_func(() => {
- assert_equals(appHistory.entries().length, 3);
- assert_equals(entry0, appHistory.entries()[0]);
- assert_equals(entry1, appHistory.entries()[1]);
- assert_equals(entry2, appHistory.entries()[2]);
+ assert_equals(navigation.entries().length, 3);
+ assert_equals(entry0, navigation.entries()[0]);
+ assert_equals(entry1, navigation.entries()[1]);
+ assert_equals(entry2, navigation.entries()[2]);
assert_equals(entry0.getState(), undefined);
@@ -38,9 +38,9 @@
history.back();
window.onpopstate = t.step_func_done(() => {
- assert_equals(appHistory.entries().length, 3);
- let back_entry = appHistory.current;
- assert_equals(back_entry, appHistory.entries()[1]);
+ assert_equals(navigation.entries().length, 3);
+ let back_entry = navigation.currentEntry;
+ assert_equals(back_entry, navigation.entries()[1]);
let back_state = back_entry.getState();
assert_not_equals(back_state, state1);
assert_not_equals(back_state, state2);
diff --git a/app-history/navigate/state/navigate-state-cross-document-location-navigate.html b/app-history/navigate/state/navigate-state-cross-document-location-navigate.html
index 384d8d9..9c869ca 100644
--- a/app-history/navigate/state/navigate-state-cross-document-location-navigate.html
+++ b/app-history/navigate/state/navigate-state-cross-document-location-navigate.html
@@ -5,15 +5,15 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
i.contentWindow.location.href = "?1";
i.onload = t.step_func_done(() => {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current.index, 1);
- assert_equals(i.contentWindow.appHistory.current.getState(), undefined);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined);
});
});
}, "appHistoryEntry.getState() behavior after cross-document location API navigation");
diff --git a/app-history/navigate/state/navigate-state-cross-document-restore.html b/app-history/navigate/state/navigate-state-cross-document-restore.html
index e1f70dc..25d0c1e 100644
--- a/app-history/navigate/state/navigate-state-cross-document-restore.html
+++ b/app-history/navigate/state/navigate-state-cross-document-restore.html
@@ -5,23 +5,23 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
let navigated_back = false;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
i.onload = t.step_func(() => {
if (navigated_back) {
- let back_entry = i.contentWindow.appHistory.current;
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
+ let back_entry = i.contentWindow.navigation.currentEntry;
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
assert_equals(back_entry.index, 0);
assert_equals(back_entry.getState().data, "value");
t.done();
} else {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
- assert_equals(i.contentWindow.appHistory.current.getState(), undefined);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined);
history.back();
navigated_back = true;
}
diff --git a/app-history/navigate/state/updateCurrent/basic.html b/app-history/navigate/state/updateCurrent/basic.html
index 00d3f59..cbcee00 100644
--- a/app-history/navigate/state/updateCurrent/basic.html
+++ b/app-history/navigate/state/updateCurrent/basic.html
@@ -4,22 +4,22 @@
<script>
async_test(t => {
- appHistory.onnavigate = t.unreached_func("navigate must not fire");
- appHistory.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
- appHistory.onnavigateerror = t.unreached_func("navigateerror must not fire");
+ navigation.onnavigate = t.unreached_func("navigate must not fire");
+ navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
+ navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");
- assert_equals(appHistory.current.getState(), undefined, "App history state starts out as undefined");
+ assert_equals(navigation.currentEntry.getState(), undefined, "App history state starts out as undefined");
assert_equals(history.state, null, "history.state starts out as null");
const newState = { key: "value" };
- appHistory.updateCurrent({ state: newState });
+ navigation.updateCurrentEntry({ state: newState });
- assert_equals(appHistory.current.getState().key, "value");
- assert_not_equals(appHistory.current.getState(), newState);
+ assert_equals(navigation.currentEntry.getState().key, "value");
+ assert_not_equals(navigation.currentEntry.getState(), newState);
assert_equals(history.state, null);
// Wait a tick to make sure no events fire asynchronously.
t.step_timeout(() => t.done(), 0);
-}, "updateCurrent() works as expected");
+}, "updateCurrentEntry() works as expected");
</script>
diff --git a/app-history/navigate/state/updateCurrent/exception-order-initial-about-blank-unserializablestate.html b/app-history/navigate/state/updateCurrent/exception-order-initial-about-blank-unserializablestate.html
index 9ecb797..010632a 100644
--- a/app-history/navigate/state/updateCurrent/exception-order-initial-about-blank-unserializablestate.html
+++ b/app-history/navigate/state/updateCurrent/exception-order-initial-about-blank-unserializablestate.html
@@ -6,8 +6,8 @@
<script>
test(() => {
assert_throws_dom("InvalidStateError", iframe.contentWindow.DOMException, () => {
- iframe.contentWindow.appHistory.updateCurrent({ state: document.body });
+ iframe.contentWindow.navigation.updateCurrentEntry({ state: document.body });
});
- assert_equals(appHistory.current.getState(), undefined);
-}, `updateCurrent() with unserializable state on the initial about:blank must throw an "InvalidStateError", not a "DataCloneError"`);
+ assert_equals(navigation.currentEntry.getState(), undefined);
+}, `updateCurrentEntry() with unserializable state on the initial about:blank must throw an "InvalidStateError", not a "DataCloneError"`);
</script>
diff --git a/app-history/navigate/state/updateCurrent/exception-order-not-fully-active-unserializablestate.html b/app-history/navigate/state/updateCurrent/exception-order-not-fully-active-unserializablestate.html
index bd13b59..1e1c1e2 100644
--- a/app-history/navigate/state/updateCurrent/exception-order-not-fully-active-unserializablestate.html
+++ b/app-history/navigate/state/updateCurrent/exception-order-not-fully-active-unserializablestate.html
@@ -6,15 +6,15 @@
<script>
async_test(t => {
window.onload = t.step_func_done(() => {
- const wAppHistory = iframe.contentWindow.appHistory;
+ const wNavigation = iframe.contentWindow.navigation;
const wDOMException = iframe.contentWindow.DOMException;
iframe.remove();
assert_throws_dom("InvalidStateError", wDOMException, () => {
- wAppHistory.updateCurrent({ state: document.body });
+ wNavigation.updateCurrentEntry({ state: document.body });
});
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
});
-}, `updateCurrent() with unserializable state while not fully active must throw an "InvalidStateError", not a "DataCloneError"`);
+}, `updateCurrentEntry() with unserializable state while not fully active must throw an "InvalidStateError", not a "DataCloneError"`);
</script>
diff --git a/app-history/navigate/state/updateCurrent/initial-about-blank.html b/app-history/navigate/state/updateCurrent/initial-about-blank.html
index 1c1d914..c28137c 100644
--- a/app-history/navigate/state/updateCurrent/initial-about-blank.html
+++ b/app-history/navigate/state/updateCurrent/initial-about-blank.html
@@ -6,8 +6,8 @@
<script>
test(() => {
assert_throws_dom("InvalidStateError", iframe.contentWindow.DOMException, () => {
- iframe.contentWindow.appHistory.updateCurrent({ state: 1 });
+ iframe.contentWindow.navigation.updateCurrentEntry({ state: 1 });
});
- assert_equals(appHistory.current.getState(), undefined);
-}, "updateCurrent() must throw if the document is still on the initial about:blank");
+ assert_equals(navigation.currentEntry.getState(), undefined);
+}, "updateCurrentEntry() must throw if the document is still on the initial about:blank");
</script>
diff --git a/app-history/navigate/state/updateCurrent/no-args.html b/app-history/navigate/state/updateCurrent/no-args.html
index 435f260..3fd011e 100644
--- a/app-history/navigate/state/updateCurrent/no-args.html
+++ b/app-history/navigate/state/updateCurrent/no-args.html
@@ -5,11 +5,11 @@
<script>
test(() => {
assert_throws_js(TypeError, () => {
- appHistory.updateCurrent();
+ navigation.updateCurrentEntry();
}, "no args");
assert_throws_js(TypeError, () => {
- appHistory.updateCurrent({});
+ navigation.updateCurrentEntry({});
}, "empty dictionary");
-}, "updateCurrent() must throw if state is not given");
+}, "updateCurrentEntry() must throw if state is not given");
</script>
diff --git a/app-history/navigate/state/updateCurrent/not-fully-active.html b/app-history/navigate/state/updateCurrent/not-fully-active.html
index ba1df86..fce5e72 100644
--- a/app-history/navigate/state/updateCurrent/not-fully-active.html
+++ b/app-history/navigate/state/updateCurrent/not-fully-active.html
@@ -6,15 +6,15 @@
<script>
async_test(t => {
window.onload = t.step_func_done(() => {
- const wAppHistory = iframe.contentWindow.appHistory;
+ const wNavigation = iframe.contentWindow.navigation;
const wDOMException = iframe.contentWindow.DOMException;
iframe.remove();
assert_throws_dom("InvalidStateError", wDOMException, () => {
- wAppHistory.updateCurrent({ state: 1 });
+ wNavigation.updateCurrentEntry({ state: 1 });
});
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
});
-}, "updateCurrent() must throw if the document is not fully active");
+}, "updateCurrentEntry() must throw if the document is not fully active");
</script>
diff --git a/app-history/navigate/state/updateCurrent/resources/opaque-origin-page.html b/app-history/navigate/state/updateCurrent/resources/opaque-origin-page.html
index d9c273a..5993145 100644
--- a/app-history/navigate/state/updateCurrent/resources/opaque-origin-page.html
+++ b/app-history/navigate/state/updateCurrent/resources/opaque-origin-page.html
@@ -5,7 +5,7 @@
<script>
test(t => {
assert_throws_dom("InvalidStateError", () => {
- appHistory.updateCurrent({ state: 1 });
+ navigation.updateCurrentEntry({ state: 1 });
});
-}, "appHistory.updateCurrent() in an opaque origin iframe");
+}, "navigation.updateCurrentEntry() in an opaque origin iframe");
</script>
diff --git a/app-history/navigate/state/updateCurrent/state-after-history-pushState.html b/app-history/navigate/state/updateCurrent/state-after-history-pushState.html
index e24fc0f..1c8858c 100644
--- a/app-history/navigate/state/updateCurrent/state-after-history-pushState.html
+++ b/app-history/navigate/state/updateCurrent/state-after-history-pushState.html
@@ -3,9 +3,9 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- appHistory.navigate("#", { replace : true, state : { data : "value" } });
- assert_equals(appHistory.current.getState().data, "value");
+ navigation.navigate("#", { replace : true, state : { data : "value" } });
+ assert_equals(navigation.currentEntry.getState().data, "value");
history.pushState(1, "", "#push");
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
}, "appHistoryEntry.getState() after history.pushState()");
</script>
diff --git a/app-history/navigate/state/updateCurrent/state-after-history-replaceState.html b/app-history/navigate/state/updateCurrent/state-after-history-replaceState.html
index 440cd48..8b4e25d 100644
--- a/app-history/navigate/state/updateCurrent/state-after-history-replaceState.html
+++ b/app-history/navigate/state/updateCurrent/state-after-history-replaceState.html
@@ -3,9 +3,9 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- appHistory.updateCurrent({ state: { data: "value" } });
- assert_equals(appHistory.current.getState().data, "value");
+ navigation.updateCurrentEntry({ state: { data: "value" } });
+ assert_equals(navigation.currentEntry.getState().data, "value");
history.replaceState(1, "", "#replace");
- assert_equals(appHistory.current.getState(), undefined);
+ assert_equals(navigation.currentEntry.getState(), undefined);
}, "appHistoryEntry.getState() after history.replaceState()");
</script>
diff --git a/app-history/navigate/state/updateCurrent/state-after-reload.html b/app-history/navigate/state/updateCurrent/state-after-reload.html
index 43d452d..664ff1b 100644
--- a/app-history/navigate/state/updateCurrent/state-after-reload.html
+++ b/app-history/navigate/state/updateCurrent/state-after-reload.html
@@ -5,14 +5,14 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.updateCurrent({ state: { data: "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.updateCurrentEntry({ state: { data: "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
i.contentWindow.location.reload();
i.onload = t.step_func_done(() => {
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
});
});
}, "appHistoryEntry.getState() after location.reload()");
diff --git a/app-history/navigate/state/updateCurrent/state-after-same-document-location-api-navigation.html b/app-history/navigate/state/updateCurrent/state-after-same-document-location-api-navigation.html
index 5d57ea0..93811c3 100644
--- a/app-history/navigate/state/updateCurrent/state-after-same-document-location-api-navigation.html
+++ b/app-history/navigate/state/updateCurrent/state-after-same-document-location-api-navigation.html
@@ -6,18 +6,18 @@
// Wait for after the load event so that the navigation doesn't get converted
// into a replace navigation.
window.onload = () => t.step_timeout(async () => {
- let entry0 = appHistory.current;
+ let entry0 = navigation.currentEntry;
let navState = { statevar: "state" };
- appHistory.updateCurrent({ state: navState });
- assert_equals(appHistory.current, entry0);
+ navigation.updateCurrentEntry({ state: navState });
+ assert_equals(navigation.currentEntry, entry0);
location.href = "#2";
- let entry1 = appHistory.current;
+ let entry1 = navigation.currentEntry;
- assert_equals(appHistory.entries().length, 2);
- assert_equals(entry0, appHistory.entries()[0]);
- assert_equals(entry1, appHistory.entries()[1]);
+ assert_equals(navigation.entries().length, 2);
+ assert_equals(entry0, navigation.entries()[0]);
+ assert_equals(entry1, navigation.entries()[1]);
assert_equals(entry0.getState().statevar, "state");
assert_not_equals(entry0.getState(), navState);
@@ -28,8 +28,8 @@
history.back();
window.onpopstate = t.step_func_done(() => {
- assert_equals(appHistory.entries().length, 2);
- let back_entry = appHistory.current;
+ assert_equals(navigation.entries().length, 2);
+ let back_entry = navigation.currentEntry;
assert_equals(back_entry, entry0);
let back_state = back_entry.getState();
assert_not_equals(back_state, navState);
diff --git a/app-history/navigate/state/updateCurrent/state-cross-document-location-navigate.html b/app-history/navigate/state/updateCurrent/state-cross-document-location-navigate.html
index 6e70b48..3b4ec68 100644
--- a/app-history/navigate/state/updateCurrent/state-cross-document-location-navigate.html
+++ b/app-history/navigate/state/updateCurrent/state-cross-document-location-navigate.html
@@ -5,15 +5,15 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.updateCurrent({ state: { data: "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.updateCurrentEntry({ state: { data: "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
i.contentWindow.location.href = "?1";
i.onload = t.step_func_done(() => {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current.index, 1);
- assert_equals(i.contentWindow.appHistory.current.getState(), undefined);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined);
});
});
}, "appHistoryEntry.getState() behavior after cross-document location API navigation");
diff --git a/app-history/navigate/state/updateCurrent/state-cross-document-restore.html b/app-history/navigate/state/updateCurrent/state-cross-document-restore.html
index f872e61..a192314 100644
--- a/app-history/navigate/state/updateCurrent/state-cross-document-restore.html
+++ b/app-history/navigate/state/updateCurrent/state-cross-document-restore.html
@@ -5,23 +5,23 @@
<script>
async_test(t => {
window.onload = t.step_func(() => {
- i.contentWindow.appHistory.updateCurrent({ state: { data: "value" } });
- assert_equals(i.contentWindow.appHistory.entries().length, 1);
- assert_equals(i.contentWindow.appHistory.current.getState().data, "value");
+ i.contentWindow.navigation.updateCurrentEntry({ state: { data: "value" } });
+ assert_equals(i.contentWindow.navigation.entries().length, 1);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
let navigated_back = false;
- i.contentWindow.appHistory.navigate("?1");
+ i.contentWindow.navigation.navigate("?1");
i.onload = t.step_func(() => {
if (navigated_back) {
- let back_entry = i.contentWindow.appHistory.current;
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
+ let back_entry = i.contentWindow.navigation.currentEntry;
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
assert_equals(back_entry.index, 0);
assert_equals(back_entry.getState().data, "value");
t.done();
} else {
- assert_equals(i.contentWindow.appHistory.entries().length, 2);
- assert_equals(i.contentWindow.appHistory.current, i.contentWindow.appHistory.entries()[1]);
- assert_equals(i.contentWindow.appHistory.current.getState(), undefined);
+ assert_equals(i.contentWindow.navigation.entries().length, 2);
+ assert_equals(i.contentWindow.navigation.currentEntry, i.contentWindow.navigation.entries()[1]);
+ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined);
history.back();
navigated_back = true;
}
diff --git a/app-history/navigate/state/updateCurrent/state-invalid.html b/app-history/navigate/state/updateCurrent/state-invalid.html
index 469b7d2..596ab16 100644
--- a/app-history/navigate/state/updateCurrent/state-invalid.html
+++ b/app-history/navigate/state/updateCurrent/state-invalid.html
@@ -9,20 +9,20 @@
window.onload = () => {
test(() => {
assert_throws_dom("DataCloneError", iframe.contentWindow.DOMException, () => {
- iframe.contentWindow.appHistory.updateCurrent({ state: new WritableStream() });
+ iframe.contentWindow.navigation.updateCurrentEntry({ state: new WritableStream() });
});
- assert_equals(appHistory.current.getState(), undefined);
- }, "updateCurrent() must throw if state is unserializable (WritableStream)");
+ assert_equals(navigation.currentEntry.getState(), undefined);
+ }, "updateCurrentEntry() must throw if state is unserializable (WritableStream)");
test(() => {
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
const buffer = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
assert_throws_dom("DataCloneError", iframe.contentWindow.DOMException, () => {
- iframe.contentWindow.appHistory.updateCurrent({ state: buffer });
+ iframe.contentWindow.navigation.updateCurrentEntry({ state: buffer });
});
- assert_equals(appHistory.current.getState(), undefined);
- }, "updateCurrent() must throw if state is unserializable (SharedArrayBuffer)");
+ assert_equals(navigation.currentEntry.getState(), undefined);
+ }, "updateCurrentEntry() must throw if state is unserializable (SharedArrayBuffer)");
done();
};
diff --git a/app-history/ordering-and-transition/README.md b/app-history/ordering-and-transition/README.md
index ec65b9d..99ea948 100644
--- a/app-history/ordering-and-transition/README.md
+++ b/app-history/ordering-and-transition/README.md
@@ -1,7 +1,7 @@
# App history ordering/transition tests
These are meant to test the ordering between various events and promises, as
-well as in some cases how the `appHistory.transition` values changes.
+well as in some cases how the `navigation.transition` values changes.
Some of them use the `Recorder` framework in `resources/helpers.mjs`, and others
test tricky cases (e.g. reentrancy) in a more ad-hoc way.
@@ -11,8 +11,8 @@
Note:
-* Variants specifically exist for `currentchange` because an event listener
- existing for `currentchange` causes code to run, and thus microtasks to run,
+* Variants specifically exist for `currententrychange` because an event listener
+ existing for `currententrychange` causes code to run, and thus microtasks to run,
at a very specific point in the navigation-commit lifecycle. We want to test
that it doesn't impact the ordering.
* Similarly we test that `transitionWhile(Promise.resolve())` does not change
diff --git a/app-history/ordering-and-transition/back-same-document-transitionWhile-reject.html b/app-history/ordering-and-transition/back-same-document-transitionWhile-reject.html
index 1255dbe..68cff80 100644
--- a/app-history/ordering-and-transition/back-same-document-transitionWhile-reject.html
+++ b/app-history/ordering-and-transition/back-same-document-transitionWhile-reject.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,23 +11,23 @@
// 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("#1").finished;
+ await navigation.navigate("#1").finished;
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const expectedError = new Error("boo");
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished rejected"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.reject(expectedError));
});
- const result = appHistory.back();
+ const result = navigation.back();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -35,10 +35,10 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["promise microtask", "#1", null],
["navigate", "#1", null],
- ["currentchange", "", { from, navigationType: "traverse" }],
+ ["currententrychange", "", { from, navigationType: "traverse" }],
["committed fulfilled", "", { from, navigationType: "traverse" }],
["navigateerror", "", { from, navigationType: "traverse" }],
["finished rejected", "", null],
@@ -46,5 +46,5 @@
]);
recorder.assertErrorsAre(expectedError);
-}, "event and promise ordering for same-document appHistory.back() intercepted by passing a rejected promise to transitionWhile()");
+}, "event and promise ordering for same-document navigation.back() intercepted by passing a rejected promise to transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/back-same-document-transitionWhile.html b/app-history/ordering-and-transition/back-same-document-transitionWhile.html
index e83ac55..30d083c 100644
--- a/app-history/ordering-and-transition/back-same-document-transitionWhile.html
+++ b/app-history/ordering-and-transition/back-same-document-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,22 +11,22 @@
// 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("#1").finished;
+ await navigation.navigate("#1").finished;
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- const result = appHistory.back();
+ const result = navigation.back();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -34,14 +34,14 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["promise microtask", "#1", null],
["navigate", "#1", null],
- ["currentchange", "", { from, navigationType: "traverse" }],
+ ["currententrychange", "", { from, navigationType: "traverse" }],
["committed fulfilled", "", { from, navigationType: "traverse" }],
["navigatesuccess", "", { from, navigationType: "traverse" }],
["finished fulfilled", "", null],
["transition.finished fulfilled", "", null]
]);
-}, "event and promise ordering for same-document appHistory.back() intercepted by transitionWhile()");
+}, "event and promise ordering for same-document navigation.back() intercepted by transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/back-same-document.html b/app-history/ordering-and-transition/back-same-document.html
index b2bec4d..cc30375 100644
--- a/app-history/ordering-and-transition/back-same-document.html
+++ b/app-history/ordering-and-transition/back-same-document.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,16 +11,16 @@
// 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("#1").finished;
+ await navigation.navigate("#1").finished;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- const result = appHistory.back();
+ const result = navigation.back();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -28,13 +28,13 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["promise microtask", "#1", null],
["navigate", "#1", null],
- ["currentchange", "", null],
+ ["currententrychange", "", null],
["committed fulfilled", "", null],
["navigatesuccess", "", null],
["finished fulfilled", "", null],
]);
-}, "event and promise ordering for same-document appHistory.back()");
+}, "event and promise ordering for same-document navigation.back()");
</script>
diff --git a/app-history/ordering-and-transition/currentchange-before-popsate-transitionWhile.html b/app-history/ordering-and-transition/currentchange-before-popsate-transitionWhile.html
index 2a0155a..f4c36fa 100644
--- a/app-history/ordering-and-transition/currentchange-before-popsate-transitionWhile.html
+++ b/app-history/ordering-and-transition/currentchange-before-popsate-transitionWhile.html
@@ -6,43 +6,43 @@
// 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);
- appHistory.onnavigate = e => e.transitionWhile(Promise.resolve());
+ navigation.onnavigate = e => e.transitionWhile(Promise.resolve());
- let oncurrentchange_back_called = false;
+ let oncurrententrychange_back_called = false;
let onpopstate_back_called = false;
window.onpopstate = t.step_func(e => {
onpopstate_back_called = true;
- assert_true(oncurrentchange_back_called);
+ assert_true(oncurrententrychange_back_called);
});
- appHistory.oncurrentchange = t.step_func(e => {
- oncurrentchange_back_called = true;
+ navigation.oncurrententrychange = t.step_func(e => {
+ oncurrententrychange_back_called = true;
assert_false(onpopstate_back_called);
});
- let back_result = appHistory.back();
- assert_false(oncurrentchange_back_called);
+ let back_result = navigation.back();
+ assert_false(oncurrententrychange_back_called);
assert_false(onpopstate_back_called);
await back_result.finished;
- assert_true(oncurrentchange_back_called);
+ assert_true(oncurrententrychange_back_called);
assert_true(onpopstate_back_called);
- let oncurrentchange_forward_called = false;
+ let oncurrententrychange_forward_called = false;
let onpopstate_forward_called = false;
window.onpopstate = t.step_func(e => {
onpopstate_forward_called = true;
- assert_true(oncurrentchange_forward_called);
+ assert_true(oncurrententrychange_forward_called);
});
- appHistory.oncurrentchange = t.step_func(e => {
- oncurrentchange_forward_called = true;
+ navigation.oncurrententrychange = t.step_func(e => {
+ oncurrententrychange_forward_called = true;
assert_false(onpopstate_forward_called);
});
- let forward_result = appHistory.forward();
- assert_false(oncurrentchange_forward_called);
+ let forward_result = navigation.forward();
+ assert_false(oncurrententrychange_forward_called);
assert_false(onpopstate_forward_called);
await forward_result.finished;
- assert_true(oncurrentchange_back_called);
+ assert_true(oncurrententrychange_back_called);
assert_true(onpopstate_forward_called);
-}, "AppHistoryCurrentChangeEvent fires for appHistory.back() and appHistory.forward()");
+}, "AppHistoryCurrentChangeEvent fires for navigation.back() and navigation.forward()");
</script>
diff --git a/app-history/ordering-and-transition/currentchange-dispose-ordering.html b/app-history/ordering-and-transition/currentchange-dispose-ordering.html
index f9d23f7..396a46f 100644
--- a/app-history/ordering-and-transition/currentchange-dispose-ordering.html
+++ b/app-history/ordering-and-transition/currentchange-dispose-ordering.html
@@ -3,24 +3,24 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- let oncurrentchange_called = false;
+ let oncurrententrychange_called = false;
let ondispose_called = false;
- let original_entry = appHistory.current;
+ let original_entry = navigation.currentEntry;
original_entry.ondispose = t.step_func(() => {
- assert_true(oncurrentchange_called);
+ assert_true(oncurrententrychange_called);
ondispose_called = true;
});
- appHistory.oncurrentchange = t.step_func(e => {
- oncurrentchange_called = true;
+ 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);
});
- appHistory.navigate("#foo", { replace: true });
- assert_true(oncurrentchange_called);
+ navigation.navigate("#foo", { replace: true });
+ assert_true(oncurrententrychange_called);
assert_true(ondispose_called);
}, "Ordering between AppHistoryCurrentChangeEvent and AppHistoryEntry dispose events");
</script>
diff --git a/app-history/ordering-and-transition/location-href-canceled.html b/app-history/ordering-and-transition/location-href-canceled.html
index ed776ff..f424741 100644
--- a/app-history/ordering-and-transition/location-href-canceled.html
+++ b/app-history/ordering-and-transition/location-href-canceled.html
@@ -16,7 +16,7 @@
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", t.step_func(e => {
+ navigation.addEventListener("navigate", t.step_func(e => {
e.preventDefault();
}));
@@ -27,7 +27,7 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
diff --git a/app-history/ordering-and-transition/location-href-double-transitionWhile.html b/app-history/ordering-and-transition/location-href-double-transitionWhile.html
index 0168dc9..6e7c895 100644
--- a/app-history/ordering-and-transition/location-href-double-transitionWhile.html
+++ b/app-history/ordering-and-transition/location-href-double-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,21 +11,21 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const fromStart = appHistory.current;
+ const fromStart = navigation.currentEntry;
let fromHash1;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(new Promise(r => t.step_timeout(r, 1)));
if (location.hash === "#1") {
- fromHash1 = appHistory.current;
+ fromHash1 = navigation.currentEntry;
}
});
@@ -37,14 +37,14 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from: fromStart, navigationType: "push" }],
+ ["currententrychange", "#1", { from: fromStart, navigationType: "push" }],
["AbortSignal abort", "#1", { from: fromStart, navigationType: "push" }],
["navigateerror", "#1", { from: fromStart, navigationType: "push" }],
["navigate", "#1", null],
- ["currentchange", "#2", { from: fromHash1, navigationType: "push" }],
+ ["currententrychange", "#2", { from: fromHash1, navigationType: "push" }],
["transition.finished rejected", "#2", { from: fromHash1, navigationType: "push" }],
["promise microtask", "#2", { from: fromHash1, navigationType: "push" }],
["navigatesuccess", "#2", { from: fromHash1, navigationType: "push" }],
diff --git a/app-history/ordering-and-transition/location-href-transitionWhile-reentrant.html b/app-history/ordering-and-transition/location-href-transitionWhile-reentrant.html
index 3b6215d..36b2355 100644
--- a/app-history/ordering-and-transition/location-href-transitionWhile-reentrant.html
+++ b/app-history/ordering-and-transition/location-href-transitionWhile-reentrant.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,17 +12,17 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
let firstNavigate = true;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
if (firstNavigate) {
@@ -39,13 +39,13 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
["navigate", "", null],
- ["currentchange", "#2", { from, navigationType: "push" }],
+ ["currententrychange", "#2", { from, navigationType: "push" }],
["promise microtask", "#2", { from, navigationType: "push" }],
["navigatesuccess", "#2", { from, navigationType: "push" }],
["transition.finished fulfilled", "#2", null]
diff --git a/app-history/ordering-and-transition/location-href-transitionWhile-reject.html b/app-history/ordering-and-transition/location-href-transitionWhile-reject.html
index e0495b4..e3f65e8 100644
--- a/app-history/ordering-and-transition/location-href-transitionWhile-reject.html
+++ b/app-history/ordering-and-transition/location-href-transitionWhile-reject.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,17 +12,17 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const expectedError = new Error("boo");
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished rejected"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.reject(expectedError));
});
@@ -33,9 +33,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from, navigationType: "push" }],
+ ["currententrychange", "#1", { from, navigationType: "push" }],
["promise microtask", "#1", { from, navigationType: "push" }],
["navigateerror", "#1", { from, navigationType: "push" }],
["transition.finished rejected", "#1", null],
diff --git a/app-history/ordering-and-transition/location-href-transitionWhile.html b/app-history/ordering-and-transition/location-href-transitionWhile.html
index 988a025..0ae4144 100644
--- a/app-history/ordering-and-transition/location-href-transitionWhile.html
+++ b/app-history/ordering-and-transition/location-href-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,16 +12,16 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
@@ -32,9 +32,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from, navigationType: "push" }],
+ ["currententrychange", "#1", { from, navigationType: "push" }],
["promise microtask", "#1", { from, navigationType: "push" }],
["navigatesuccess", "#1", { from, navigationType: "push" }],
["transition.finished fulfilled", "#1", null],
diff --git a/app-history/ordering-and-transition/navigate-canceled.html b/app-history/ordering-and-transition/navigate-canceled.html
index 5502841..851fa34 100644
--- a/app-history/ordering-and-transition/navigate-canceled.html
+++ b/app-history/ordering-and-transition/navigate-canceled.html
@@ -16,11 +16,11 @@
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", t.step_func(e => {
+ navigation.addEventListener("navigate", t.step_func(e => {
e.preventDefault();
}));
- const result = appHistory.navigate("/common/blank.html#1");
+ const result = navigation.navigate("/common/blank.html#1");
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -28,7 +28,7 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
@@ -38,5 +38,5 @@
]);
recorder.assertErrorsAreAbortErrors();
-}, "event and promise ordering for appHistory.navigate() where the navigate event is canceled");
+}, "event and promise ordering for navigation.navigate() where the navigate event is canceled");
</script>
diff --git a/app-history/ordering-and-transition/navigate-cross-document-double.html b/app-history/ordering-and-transition/navigate-cross-document-double.html
index ba1edce..353cfa1 100644
--- a/app-history/ordering-and-transition/navigate-cross-document-double.html
+++ b/app-history/ordering-and-transition/navigate-cross-document-double.html
@@ -7,14 +7,14 @@
await new Promise(resolve => window.onload = resolve);
let start_href = i.contentWindow.location.href;
let events = [];
- i.contentWindow.appHistory.onnavigateerror = () => events.push("navigateerror");
- i.contentWindow.appHistory.onnavigate = t.step_func(e => {
+ i.contentWindow.navigation.onnavigateerror = () => events.push("navigateerror");
+ i.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(i.contentWindow.location.href, start_href);
events.push("navigate");
e.signal.onabort = () => events.push("abort");
});
- i.contentWindow.appHistory.navigate("?1").committed.finally(t.unreached_func("navigate to ?1"));
- i.contentWindow.appHistory.navigate("?2").committed.finally(t.unreached_func("navigate to ?2"));
+ i.contentWindow.navigation.navigate("?1").committed.finally(t.unreached_func("navigate to ?1"));
+ i.contentWindow.navigation.navigate("?2").committed.finally(t.unreached_func("navigate to ?2"));
assert_equals(i.contentWindow.location.search, "");
await new Promise(resolve => i.onload = resolve);
assert_equals(i.contentWindow.location.search, "?2");
diff --git a/app-history/ordering-and-transition/navigate-cross-document-event-order.html b/app-history/ordering-and-transition/navigate-cross-document-event-order.html
index 1c1758a..34a9b79 100644
--- a/app-history/ordering-and-transition/navigate-cross-document-event-order.html
+++ b/app-history/ordering-and-transition/navigate-cross-document-event-order.html
@@ -12,8 +12,8 @@
window.onload = t.step_func(() => {
window.childStarted = () => {
- i.contentWindow.appHistory.onnavigatesuccess = () => events.push("onnavigatesuccess");
- i.contentWindow.appHistory.onnavigateerror = () => events.push("onnavigateerror");
+ i.contentWindow.navigation.onnavigatesuccess = () => events.push("onnavigatesuccess");
+ i.contentWindow.navigation.onnavigateerror = () => events.push("onnavigateerror");
i.contentWindow.onpageshow = () => events.push("onpageshow");
i.contentWindow.onhashchange = () => events.push("onhashchange");
i.contentWindow.onpopstate = () => events.push("onpopstate");
@@ -24,8 +24,8 @@
i.contentDocument.addEventListener("DOMContentLoaded", () => events.push("domcontentloaded"));
i.contentDocument.onreadystatechange = () => events.push("readystate" + i.contentDocument.readyState);
};
- i.contentWindow.appHistory.onnavigate = () => events.push("onnavigate");
- i.contentWindow.appHistory.navigate("?1").committed.then(
+ i.contentWindow.navigation.onnavigate = () => events.push("onnavigate");
+ i.contentWindow.navigation.navigate("?1").committed.then(
() => events.push("promisefulfilled"), () => events.push("promiserejected"));
});
}, "navigate() event ordering for cross-document navigation");
diff --git a/app-history/ordering-and-transition/navigate-double-transitionWhile.html b/app-history/ordering-and-transition/navigate-double-transitionWhile.html
index eb54f9e..4413ca4 100644
--- a/app-history/ordering-and-transition/navigate-double-transitionWhile.html
+++ b/app-history/ordering-and-transition/navigate-double-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,28 +11,28 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const fromStart = appHistory.current;
+ const fromStart = navigation.currentEntry;
let fromHash1;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(new Promise(r => t.step_timeout(r, 1)));
if (location.hash === "#1") {
- fromHash1 = appHistory.current;
+ fromHash1 = navigation.currentEntry;
}
});
- const result1 = appHistory.navigate("/common/blank.html#1");
+ const result1 = navigation.navigate("/common/blank.html#1");
recorder.setUpResultListeners(result1, " 1");
- const result2 = appHistory.navigate("/common/blank.html#2");
+ const result2 = navigation.navigate("/common/blank.html#2");
recorder.setUpResultListeners(result2, " 2");
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -40,14 +40,14 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from: fromStart, navigationType: "push" }],
+ ["currententrychange", "#1", { from: fromStart, navigationType: "push" }],
["AbortSignal abort", "#1", { from: fromStart, navigationType: "push" }],
["navigateerror", "#1", { from: fromStart, navigationType: "push" }],
["navigate", "#1", null],
- ["currentchange", "#2", { from: fromHash1, navigationType: "push" }],
+ ["currententrychange", "#2", { from: fromHash1, navigationType: "push" }],
["committed fulfilled 1", "#2", { from: fromHash1, navigationType: "push" }],
["finished rejected 1", "#2", { from: fromHash1, navigationType: "push" }],
["transition.finished rejected", "#2", { from: fromHash1, navigationType: "push" }],
diff --git a/app-history/ordering-and-transition/navigate-in-transition-finished.html b/app-history/ordering-and-transition/navigate-in-transition-finished.html
index f84be14..f8ebd69 100644
--- a/app-history/ordering-and-transition/navigate-in-transition-finished.html
+++ b/app-history/ordering-and-transition/navigate-in-transition-finished.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -11,35 +11,35 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const fromStart = appHistory.current;
+ const fromStart = navigation.currentEntry;
let fromHash1;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled",
finalExpectedEventCount: 2
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigatesuccess", t.step_func(() => {
+ navigation.addEventListener("navigatesuccess", t.step_func(() => {
if (location.hash === "#1") {
- appHistory.transition.finished.then(() => {
- const result2 = appHistory.navigate("/common/blank.html#2");
+ navigation.transition.finished.then(() => {
+ const result2 = navigation.navigate("/common/blank.html#2");
recorder.setUpResultListeners(result2, " 2");
});
}
}));
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
if (location.hash === "#1") {
- fromHash1 = appHistory.current;
+ fromHash1 = navigation.currentEntry;
}
});
- const result1 = appHistory.navigate("/common/blank.html#1");
+ const result1 = navigation.navigate("/common/blank.html#1");
recorder.setUpResultListeners(result1, " 1");
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -47,9 +47,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from: fromStart, navigationType: "push" }],
+ ["currententrychange", "#1", { from: fromStart, navigationType: "push" }],
["committed fulfilled 1", "#1", { from: fromStart, navigationType: "push" }],
["promise microtask", "#1", { from: fromStart, navigationType: "push" }],
["navigatesuccess", "#1", { from: fromStart, navigationType: "push" }],
@@ -57,7 +57,7 @@
["transition.finished fulfilled", "#1", null],
["navigate", "#1", null],
- ["currentchange", "#2", { from: fromHash1, navigationType: "push" }],
+ ["currententrychange", "#2", { from: fromHash1, navigationType: "push" }],
["committed fulfilled 2", "#2", { from: fromHash1, navigationType: "push" }],
["navigatesuccess", "#2", { from: fromHash1, navigationType: "push" }],
["finished fulfilled 2", "#2", null],
diff --git a/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html b/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html
index 0170dec..8cbb98e 100644
--- a/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html
+++ b/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,28 +12,28 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
let firstNavigate = true;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
if (firstNavigate) {
firstNavigate = false;
- const result2 = appHistory.navigate("#2");
+ const result2 = navigation.navigate("#2");
recorder.setUpResultListeners(result2, " 2");
}
});
- const result1 = appHistory.navigate("#1");
+ const result1 = navigation.navigate("#1");
recorder.setUpResultListeners(result1, " 1");
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -41,13 +41,13 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
["navigate", "", null],
- ["currentchange", "#2", { from, navigationType: "push" }],
+ ["currententrychange", "#2", { from, navigationType: "push" }],
["committed fulfilled 2", "#2", { from, navigationType: "push" }],
["committed rejected 1", "#2", { from, navigationType: "push" }],
["finished rejected 1", "#2", { from, navigationType: "push" }],
@@ -58,5 +58,5 @@
]);
recorder.assertErrorsAreAbortErrors();
-}, "event and promise ordering for same-document appHistory.navigate() inside the navigate handler");
+}, "event and promise ordering for same-document navigation.navigate() inside the navigate handler");
</script>
diff --git a/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reject.html b/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reject.html
index f46f926..45ce700 100644
--- a/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reject.html
+++ b/app-history/ordering-and-transition/navigate-same-document-transitionWhile-reject.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,21 +12,21 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const expectedError = new Error("boo");
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished rejected"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.reject(expectedError));
});
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -34,9 +34,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from, navigationType: "push" }],
+ ["currententrychange", "#1", { from, navigationType: "push" }],
["committed fulfilled", "#1", { from, navigationType: "push" }],
["promise microtask", "#1", { from, navigationType: "push" }],
["navigateerror", "#1", { from, navigationType: "push" }],
@@ -45,5 +45,5 @@
]);
recorder.assertErrorsAre(expectedError);
-}, "event and promise ordering for same-document appHistory.navigate() intercepted by passing a rejected promise to transitionWhile()");
+}, "event and promise ordering for same-document navigation.navigate() intercepted by passing a rejected promise to transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/navigate-same-document.html b/app-history/ordering-and-transition/navigate-same-document.html
index 1fa2709..07f7bdc 100644
--- a/app-history/ordering-and-transition/navigate-same-document.html
+++ b/app-history/ordering-and-transition/navigate-same-document.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -13,13 +13,13 @@
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -27,13 +27,13 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", null],
+ ["currententrychange", "#1", null],
["committed fulfilled", "#1", null],
["promise microtask", "#1", null],
["navigatesuccess", "#1", null],
["finished fulfilled", "#1", null],
]);
-}, "event and promise ordering for same-document appHistory.navigate()");
+}, "event and promise ordering for same-document navigation.navigate()");
</script>
diff --git a/app-history/ordering-and-transition/navigate-transitionWhile-stop.html b/app-history/ordering-and-transition/navigate-transitionWhile-stop.html
index 382dc9e..9d06ba1 100644
--- a/app-history/ordering-and-transition/navigate-transitionWhile-stop.html
+++ b/app-history/ordering-and-transition/navigate-transitionWhile-stop.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,20 +12,20 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished rejected"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- const result = appHistory.navigate("/common/blank.html#1");
+ const result = navigation.navigate("/common/blank.html#1");
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -35,9 +35,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from, navigationType: "push" }],
+ ["currententrychange", "#1", { from, navigationType: "push" }],
["AbortSignal abort", "#1", { from, navigationType: "push" }],
["navigateerror", "#1", { from, navigationType: "push" }],
["committed fulfilled", "#1", null],
@@ -47,5 +47,5 @@
]);
recorder.assertErrorsAreAbortErrors();
-}, "event and promise ordering for appHistory.navigate() intercepted by transitionWhile() but then stopped using window.stop()");
+}, "event and promise ordering for navigation.navigate() intercepted by transitionWhile() but then stopped using window.stop()");
</script>
diff --git a/app-history/ordering-and-transition/navigate-transitionWhile.html b/app-history/ordering-and-transition/navigate-transitionWhile.html
index fdc7428..d3125b0 100644
--- a/app-history/ordering-and-transition/navigate-transitionWhile.html
+++ b/app-history/ordering-and-transition/navigate-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,20 +12,20 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- const result = appHistory.navigate("#1");
+ const result = navigation.navigate("#1");
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -33,14 +33,14 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "#1", { from, navigationType: "push" }],
+ ["currententrychange", "#1", { from, navigationType: "push" }],
["committed fulfilled", "#1", { from, navigationType: "push" }],
["promise microtask", "#1", { from, navigationType: "push" }],
["navigatesuccess", "#1", { from, navigationType: "push" }],
["finished fulfilled", "#1", null],
["transition.finished fulfilled", "#1", null],
]);
-}, "event and promise ordering for same-document appHistory.navigate() intercepted by transitionWhile()");
+}, "event and promise ordering for same-document navigation.navigate() intercepted by transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/reload-canceled.html b/app-history/ordering-and-transition/reload-canceled.html
index 0e060d2..a7ae791 100644
--- a/app-history/ordering-and-transition/reload-canceled.html
+++ b/app-history/ordering-and-transition/reload-canceled.html
@@ -16,11 +16,11 @@
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", t.step_func(e => {
+ navigation.addEventListener("navigate", t.step_func(e => {
e.preventDefault();
}));
- const result = appHistory.reload();
+ const result = navigation.reload();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -28,7 +28,7 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
["AbortSignal abort", "", null],
["navigateerror", "", null],
@@ -38,5 +38,5 @@
]);
recorder.assertErrorsAreAbortErrors();
-}, "event and promise ordering for appHistory.reload() where the navigate event is canceled");
+}, "event and promise ordering for navigation.reload() where the navigate event is canceled");
</script>
diff --git a/app-history/ordering-and-transition/reload-transitionWhile-reject.html b/app-history/ordering-and-transition/reload-transitionWhile-reject.html
index 88fbe9a..0a70c6d 100644
--- a/app-history/ordering-and-transition/reload-transitionWhile-reject.html
+++ b/app-history/ordering-and-transition/reload-transitionWhile-reject.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,21 +12,21 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const expectedError = new Error("boo");
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished rejected"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.reject(expectedError));
});
- const result = appHistory.reload();
+ const result = navigation.reload();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -34,9 +34,9 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "", { from, navigationType: "reload" }],
+ ["currententrychange", "", { from, navigationType: "reload" }],
["committed fulfilled", "", { from, navigationType: "reload" }],
["promise microtask", "", { from, navigationType: "reload" }],
["navigateerror", "", { from, navigationType: "reload" }],
@@ -45,5 +45,5 @@
]);
recorder.assertErrorsAre(expectedError);
-}, "event and promise ordering for appHistory.reload() intercepted by transitionWhile()");
+}, "event and promise ordering for navigation.reload() intercepted by transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/reload-transitionWhile.html b/app-history/ordering-and-transition/reload-transitionWhile.html
index 235cfd0..8cc237f 100644
--- a/app-history/ordering-and-transition/reload-transitionWhile.html
+++ b/app-history/ordering-and-transition/reload-transitionWhile.html
@@ -2,7 +2,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
-<meta name="variant" content="?currentchange">
+<meta name="variant" content="?currententrychange">
<script type="module">
import { Recorder, hasVariant } from "./resources/helpers.mjs";
@@ -12,20 +12,20 @@
// into a replace navigation.
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
- const from = appHistory.current;
+ const from = navigation.currentEntry;
const recorder = new Recorder({
- skipCurrentChange: !hasVariant("currentchange"),
+ skipCurrentChange: !hasVariant("currententrychange"),
finalExpectedEvent: "transition.finished fulfilled"
});
recorder.setUpAppHistoryListeners();
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- const result = appHistory.reload();
+ const result = navigation.reload();
recorder.setUpResultListeners(result);
Promise.resolve().then(() => recorder.record("promise microtask"));
@@ -33,14 +33,14 @@
await recorder.readyToAssert;
recorder.assert([
- /* event name, location.hash value, appHistory.transition properties */
+ /* event name, location.hash value, navigation.transition properties */
["navigate", "", null],
- ["currentchange", "", { from, navigationType: "reload" }],
+ ["currententrychange", "", { from, navigationType: "reload" }],
["committed fulfilled", "", { from, navigationType: "reload" }],
["promise microtask", "", { from, navigationType: "reload" }],
["navigatesuccess", "", { from, navigationType: "reload" }],
["finished fulfilled", "", null],
["transition.finished fulfilled", "", null],
]);
-}, "event and promise ordering for appHistory.reload() intercepted by transitionWhile()");
+}, "event and promise ordering for navigation.reload() intercepted by transitionWhile()");
</script>
diff --git a/app-history/ordering-and-transition/resources/helpers.mjs b/app-history/ordering-and-transition/resources/helpers.mjs
index 1cbf6e7..b5a1e6b 100644
--- a/app-history/ordering-and-transition/resources/helpers.mjs
+++ b/app-history/ordering-and-transition/resources/helpers.mjs
@@ -24,7 +24,7 @@
}
setUpAppHistoryListeners() {
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
this.record("navigate");
e.signal.addEventListener("abort", () => {
@@ -32,26 +32,26 @@
});
});
- appHistory.addEventListener("navigateerror", e => {
+ navigation.addEventListener("navigateerror", e => {
this.recordWithError("navigateerror", e.error);
- appHistory.transition?.finished.then(
+ navigation.transition?.finished.then(
() => this.record("transition.finished fulfilled"),
err => this.recordWithError("transition.finished rejected", err)
);
});
- appHistory.addEventListener("navigatesuccess", () => {
+ navigation.addEventListener("navigatesuccess", () => {
this.record("navigatesuccess");
- appHistory.transition?.finished.then(
+ navigation.transition?.finished.then(
() => this.record("transition.finished fulfilled"),
err => this.recordWithError("transition.finished rejected", err)
);
});
if (!this.#skipCurrentChange) {
- appHistory.addEventListener("currentchange", () => this.record("currentchange"));
+ navigation.addEventListener("currententrychange", () => this.record("currententrychange"));
}
}
@@ -68,9 +68,9 @@
}
record(name) {
- const transitionProps = appHistory.transition === null ? null : {
- from: appHistory.transition.from,
- navigationType: appHistory.transition.navigationType
+ const transitionProps = navigation.transition === null ? null : {
+ from: navigation.transition.from,
+ navigationType: navigation.transition.navigationType
};
this.#events.push({ name, location: location.hash, transitionProps });
@@ -91,8 +91,8 @@
// Usage:
// recorder.assert([
- // /* event name, location.hash value, appHistory.transition properties */
- // ["currentchange", "", null],
+ // /* event name, location.hash value, navigation.transition properties */
+ // ["currententrychange", "", null],
// ["committed fulfilled", "#1", { from, navigationType }],
// ...
// ]);
@@ -105,7 +105,7 @@
// contents of the error objects.
assert(expectedAsArray) {
if (this.#skipCurrentChange) {
- expectedAsArray = expectedAsArray.filter(expected => expected[0] !== "currentchange");
+ expectedAsArray = expectedAsArray.filter(expected => expected[0] !== "currententrychange");
}
// Doing this up front gives nicer error messages because
@@ -128,23 +128,23 @@
assert_equals(
recorded.transitionProps,
null,
- `event ${i} (${recorded.name}): appHistory.transition expected to be null`
+ `event ${i} (${recorded.name}): navigation.transition expected to be null`
);
} else {
assert_not_equals(
recorded.transitionProps,
null,
- `event ${i} (${recorded.name}): appHistory.transition expected not to be null`
+ `event ${i} (${recorded.name}): navigation.transition expected not to be null`
);
assert_equals(
recorded.transitionProps.from,
expected[2].from,
- `event ${i} (${recorded.name}): appHistory.transition.from`
+ `event ${i} (${recorded.name}): navigation.transition.from`
);
assert_equals(
recorded.transitionProps.navigationType,
expected[2].navigationType,
- `event ${i} (${recorded.name}): appHistory.transition.navigationType`
+ `event ${i} (${recorded.name}): navigation.transition.navigationType`
);
}
}
diff --git a/app-history/ordering-and-transition/transition-cross-document.html b/app-history/ordering-and-transition/transition-cross-document.html
index 400ccce..4a14a10 100644
--- a/app-history/ordering-and-transition/transition-cross-document.html
+++ b/app-history/ordering-and-transition/transition-cross-document.html
@@ -10,34 +10,34 @@
// into a replace navigation.
await new Promise(r => window.onload = () => t.step_timeout(r, 0));
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("navigateerror must not fire");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");
- assert_equals(i.contentWindow.appHistory.transition, null);
- i.contentWindow.appHistory.reload();
- assert_equals(i.contentWindow.appHistory.transition, null);
+ assert_equals(i.contentWindow.navigation.transition, null);
+ i.contentWindow.navigation.reload();
+ assert_equals(i.contentWindow.navigation.transition, null);
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
}, "cross-document reload() must leave transition null");
promise_test(async t => {
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("navigateerror must not fire");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");
- assert_equals(i.contentWindow.appHistory.transition, null);
- i.contentWindow.appHistory.navigate("?1");
- assert_equals(i.contentWindow.appHistory.transition, null);
+ assert_equals(i.contentWindow.navigation.transition, null);
+ i.contentWindow.navigation.navigate("?1");
+ assert_equals(i.contentWindow.navigation.transition, null);
await new Promise(r => i.onload = () => t.step_timeout(r, 0));
}, "cross-document navigate() must leave transition null");
promise_test(async t => {
- i.contentWindow.appHistory.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
- i.contentWindow.appHistory.onnavigateerror = t.unreached_func("navigateerror must not fire");
+ i.contentWindow.navigation.onnavigatesuccess = t.unreached_func("navigatesuccess must not fire");
+ i.contentWindow.navigation.onnavigateerror = t.unreached_func("navigateerror must not fire");
- assert_equals(i.contentWindow.appHistory.transition, null);
- i.contentWindow.appHistory.back();
- assert_equals(i.contentWindow.appHistory.transition, null);
+ assert_equals(i.contentWindow.navigation.transition, null);
+ i.contentWindow.navigation.back();
+ assert_equals(i.contentWindow.navigation.transition, null);
await new Promise(r => i.onload = r);
}, "cross-document back() must leave transition null");
diff --git a/app-history/ordering-and-transition/transition-finished-mark-as-handled.html b/app-history/ordering-and-transition/transition-finished-mark-as-handled.html
index c3b2723..859e07d 100644
--- a/app-history/ordering-and-transition/transition-finished-mark-as-handled.html
+++ b/app-history/ordering-and-transition/transition-finished-mark-as-handled.html
@@ -4,7 +4,7 @@
<script>
async_test(t => {
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.reject(new Error("oh no!")));
});
@@ -13,8 +13,8 @@
location.href = "?1";
// Make sure to trigger the getter to ensure the promise materializes!
- appHistory.transition.finished;
+ navigation.transition.finished;
t.step_timeout(() => t.done(), 10);
-}, "appHistory.transition.finished must not trigger unhandled rejections");
+}, "navigation.transition.finished must not trigger unhandled rejections");
</script>
diff --git a/app-history/ordering-and-transition/transition-realms-and-identity.html b/app-history/ordering-and-transition/transition-realms-and-identity.html
index 8b825da..16fb818 100644
--- a/app-history/ordering-and-transition/transition-realms-and-identity.html
+++ b/app-history/ordering-and-transition/transition-realms-and-identity.html
@@ -8,12 +8,12 @@
promise_test(async () => {
await new Promise(resolve => window.onload = resolve);
- i.contentWindow.appHistory.addEventListener("navigate", e => {
+ i.contentWindow.navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- const returnValueFinished1 = i.contentWindow.appHistory.navigate("?1").finished;
- const transition1 = i.contentWindow.appHistory.transition;
+ const returnValueFinished1 = i.contentWindow.navigation.navigate("?1").finished;
+ const transition1 = i.contentWindow.navigation.transition;
const transitionFinished1 = transition1.finished;
assert_true(returnValueFinished1 instanceof i.contentWindow.Promise);
@@ -23,19 +23,19 @@
assert_not_equals(returnValueFinished1, transitionFinished1);
// Ensure the getters aren't generating new objects each time.
- assert_equals(i.contentWindow.appHistory.transition, transition1);
- assert_equals(i.contentWindow.appHistory.transition.finished, transitionFinished1);
+ assert_equals(i.contentWindow.navigation.transition, transition1);
+ assert_equals(i.contentWindow.navigation.transition.finished, transitionFinished1);
assert_equals(await transitionFinished1, undefined);
// Ensure stuff does change after another navigation.
- const committed2 = i.contentWindow.appHistory.navigate("?2").committed;
- const transition2 = i.contentWindow.appHistory.transition;
+ const committed2 = i.contentWindow.navigation.navigate("?2").committed;
+ const transition2 = i.contentWindow.navigation.transition;
const transitionFinished2 = transition2.finished;
assert_not_equals(transition2, transition1);
assert_not_equals(transitionFinished2, transitionFinished1);
await committed2;
-}, "Realm and identity of the appHistory.transition object and its finished promise");
+}, "Realm and identity of the navigation.transition object and its finished promise");
</script>
diff --git a/app-history/per-entry-events/dispose-after-bfcache.html b/app-history/per-entry-events/dispose-after-bfcache.html
index db24158..7d3ef4f 100644
--- a/app-history/per-entry-events/dispose-after-bfcache.html
+++ b/app-history/per-entry-events/dispose-after-bfcache.html
@@ -10,22 +10,22 @@
// This test:
// * Does a fragment navigation, then goes back (same-document).
// * Navigates away, then back via bfcache.
-// When navigating away, appHistory.entries()[1] will be overwritten.
-// When returning after bfcache restore, appHistory.entries()[1] should represent
-// pageB, and the original appHistory.entries()[1] should have been disposed.
+// When navigating away, navigation.entries()[1] will be overwritten.
+// When returning after bfcache restore, navigation.entries()[1] should represent
+// pageB, and the original navigation.entries()[1] should have been disposed.
runBfcacheTest({
targetOrigin: originSameOrigin,
funcBeforeNavigation: async () => {
window.events = [];
- await appHistory.navigate("#1");
- await appHistory.back();
- window.originalEntry1 = appHistory.entries()[1];
+ await navigation.navigate("#1");
+ await navigation.back();
+ window.originalEntry1 = navigation.entries()[1];
window.originalEntry1.ondispose = () => events.push("dispose");
window.onpageshow = () => events.push("pageshow");
},
async funcAfterAssertion(pageA, pageB) {
- assert_equals(await pageA.execute_script(() => appHistory.entries().length), 2);
- assert_false(await pageA.execute_script(() => window.originalEntry1 === appHistory.entries[1]));
+ assert_equals(await pageA.execute_script(() => navigation.entries().length), 2);
+ assert_false(await pageA.execute_script(() => window.originalEntry1 === navigation.entries[1]));
assert_array_equals(await pageA.execute_script(() => window.events), ["pageshow", "dispose"]);
}
}, "entries() must contain the forward-history page after navigating back to a bfcached page");
diff --git a/app-history/per-entry-events/dispose-cross-document.html b/app-history/per-entry-events/dispose-cross-document.html
index 22ea15b..67f54da 100644
--- a/app-history/per-entry-events/dispose-cross-document.html
+++ b/app-history/per-entry-events/dispose-cross-document.html
@@ -11,25 +11,25 @@
iframe.contentWindow.location.search = "?1";
await new Promise(r => iframe.onload = () => t.step_timeout(r, 0));
- const keyFor1 = iframe.contentWindow.appHistory.current.key;
+ const keyFor1 = iframe.contentWindow.navigation.currentEntry.key;
iframe.contentWindow.location.search = "?2";
await new Promise(r => iframe.onload = () => t.step_timeout(r, 0));
iframe.contentWindow.location.search = "?3";
await new Promise(r => iframe.onload = () => t.step_timeout(r, 0));
- iframe.contentWindow.appHistory.goTo(keyFor1);
+ iframe.contentWindow.navigation.traverseTo(keyFor1);
await new Promise(r => iframe.onload = () => t.step_timeout(r, 0));
assert_equals((new URL(iframe.contentWindow.location.href)).search, "?1");
- assert_equals(iframe.contentWindow.appHistory.entries().length, 4);
- const [, entry2, entry3] = iframe.contentWindow.appHistory.entries();
+ assert_equals(iframe.contentWindow.navigation.entries().length, 4);
+ const [, entry2, entry3] = iframe.contentWindow.navigation.entries();
entry2.ondispose = t.unreached_func("entry2 dispose must not fire");
entry2.addEventListener("dispose", t.unreached_func("entry3 dispose must not fire"));
- iframe.contentWindow.appHistory.navigate("/common/blank.html?fork");
+ iframe.contentWindow.navigation.navigate("/common/blank.html?fork");
await new Promise(r => iframe.onload = r);
// Test passes if we reached this point with no dispose events firing.
diff --git a/app-history/per-entry-events/dispose-same-document-navigate-during.html b/app-history/per-entry-events/dispose-same-document-navigate-during.html
index e539eab..59d9b3c 100644
--- a/app-history/per-entry-events/dispose-same-document-navigate-during.html
+++ b/app-history/per-entry-events/dispose-same-document-navigate-during.html
@@ -11,8 +11,8 @@
location.hash = "#2";
location.hash = "#3";
- assert_equals(appHistory.entries().length, 4);
- const [entry0, entry1, entry2, entry3] = appHistory.entries();
+ assert_equals(navigation.entries().length, 4);
+ const [entry0, entry1, entry2, entry3] = navigation.entries();
assert_equals((new URL(entry2.url)).hash, "#2");
assert_equals((new URL(entry3.url)).hash, "#3");
@@ -21,12 +21,12 @@
entry3.addEventListener("dispose", t.step_func(e => {
++dispose3Called;
- spoonPromise = appHistory.navigate("#spoon").committed;
+ spoonPromise = navigation.navigate("#spoon").committed;
}));
- await appHistory.goTo(entry1.key).committed;
+ await navigation.traverseTo(entry1.key).committed;
- const forkPromise = appHistory.navigate("#fork").committed;
+ const forkPromise = navigation.navigate("#fork").committed;
assert_equals(dispose3Called, 1, "dispose for entry 3 must happen exactly once (first check)")
// The navigation to #fork will *not* be finished by the time the navigation
@@ -37,13 +37,13 @@
assert_equals(dispose3Called, 1, "dispose for entry 3 must happen exactly once (final check)");
- assert_equals(appHistory.entries().length, 4);
- const [finalEntry0, finalEntry1, finalEntry2, finalEntry3] = appHistory.entries();
+ assert_equals(navigation.entries().length, 4);
+ const [finalEntry0, finalEntry1, finalEntry2, finalEntry3] = navigation.entries();
assert_equals(finalEntry0, entry0);
assert_equals(finalEntry1, entry1);
assert_not_equals(finalEntry2, entry2);
assert_not_equals(finalEntry3, entry3);
- assert_equals(appHistory.current, finalEntry3);
+ assert_equals(navigation.currentEntry, finalEntry3);
assert_equals((new URL(finalEntry2.url)).hash, "#fork");
assert_equals((new URL(finalEntry3.url)).hash, "#spoon");
}, "navigate() during a same-document-navigation-initiated dispose works (since it's after the previous navigation)");
diff --git a/app-history/per-entry-events/dispose-same-document-reload-with-transitionWhile.html b/app-history/per-entry-events/dispose-same-document-reload-with-transitionWhile.html
index a9b01eb..b55bfb4 100644
--- a/app-history/per-entry-events/dispose-same-document-reload-with-transitionWhile.html
+++ b/app-history/per-entry-events/dispose-same-document-reload-with-transitionWhile.html
@@ -8,10 +8,10 @@
// into a replace navigation.
await new Promise(r => window.onload = () => t.step_timeout(r, 0));
- appHistory.current.ondispose = t.unreached_func("dispose must not happen for reloads");
+ navigation.currentEntry.ondispose = t.unreached_func("dispose must not happen for reloads");
- appHistory.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
+ navigation.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
- await appHistory.reload().finished;
-}, "dispose events are not fired when doing a same-document reload using appHistory.reload() and transitionWhile()");
+ await navigation.reload().finished;
+}, "dispose events are not fired when doing a same-document reload using navigation.reload() and transitionWhile()");
</script>
diff --git a/app-history/per-entry-events/dispose-same-document-replace-with-transitionWhile.html b/app-history/per-entry-events/dispose-same-document-replace-with-transitionWhile.html
index 7efac92..1931cd3 100644
--- a/app-history/per-entry-events/dispose-same-document-replace-with-transitionWhile.html
+++ b/app-history/per-entry-events/dispose-same-document-replace-with-transitionWhile.html
@@ -8,11 +8,11 @@
// automatically before the load event completes.
await new Promise(r => window.onload = () => t.step_timeout(r, 0));
- const entriesBefore = appHistory.entries();
- const currentBefore = appHistory.current;
+ const entriesBefore = navigation.entries();
+ const currentBefore = navigation.currentEntry;
let disposeCalled = false;
- appHistory.current.ondispose = t.step_func(e => {
+ navigation.currentEntry.ondispose = t.step_func(e => {
disposeCalled = true;
assert_equals(e.constructor, Event);
@@ -20,17 +20,17 @@
assert_equals(e.cancelable, false);
assert_equals(e.composed, false);
- assert_not_equals(appHistory.current, currentBefore);
- assert_array_equals(appHistory.entries(), [appHistory.current]);
- assert_equals((new URL(appHistory.current.url)).search, "?replacement");
- assert_equals(appHistory.transition.navigationType, "replace");
- assert_equals(appHistory.transition.from, entriesBefore[0]);
+ assert_not_equals(navigation.currentEntry, currentBefore);
+ assert_array_equals(navigation.entries(), [navigation.currentEntry]);
+ assert_equals((new URL(navigation.currentEntry.url)).search, "?replacement");
+ assert_equals(navigation.transition.navigationType, "replace");
+ assert_equals(navigation.transition.from, entriesBefore[0]);
assert_equals(location.search, "?replacement");
});
- appHistory.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
+ navigation.addEventListener("navigate", e => e.transitionWhile(Promise.resolve()));
- appHistory.navigate("?replacement", { replace: true });
+ navigation.navigate("?replacement", { replace: true });
assert_true(disposeCalled);
-}, "dispose events when doing a same-document replace using appHistory.navigate() and transitionWhile()");
+}, "dispose events when doing a same-document replace using navigation.navigate() and transitionWhile()");
</script>
diff --git a/app-history/per-entry-events/dispose-same-document-replaceState.html b/app-history/per-entry-events/dispose-same-document-replaceState.html
index 6da4c8e..a619726 100644
--- a/app-history/per-entry-events/dispose-same-document-replaceState.html
+++ b/app-history/per-entry-events/dispose-same-document-replaceState.html
@@ -3,11 +3,11 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
- const entriesBefore = appHistory.entries();
- const currentBefore = appHistory.current;
+ const entriesBefore = navigation.entries();
+ const currentBefore = navigation.currentEntry;
let disposeCalled = false;
- appHistory.current.ondispose = t.step_func(e => {
+ navigation.currentEntry.ondispose = t.step_func(e => {
disposeCalled = true;
assert_equals(e.constructor, Event);
@@ -15,10 +15,10 @@
assert_equals(e.cancelable, false);
assert_equals(e.composed, false);
- assert_not_equals(appHistory.current, currentBefore);
- assert_array_equals(appHistory.entries(), [appHistory.current]);
- assert_equals((new URL(appHistory.current.url)).search, "?replacement");
- assert_equals(appHistory.transition, null);
+ assert_not_equals(navigation.currentEntry, currentBefore);
+ assert_array_equals(navigation.entries(), [navigation.currentEntry]);
+ assert_equals((new URL(navigation.currentEntry.url)).search, "?replacement");
+ assert_equals(navigation.transition, null);
assert_equals(location.search, "?replacement");
});
diff --git a/app-history/per-entry-events/dispose-same-document-transitionWhile.html b/app-history/per-entry-events/dispose-same-document-transitionWhile.html
index 97ed346..2c0b92e 100644
--- a/app-history/per-entry-events/dispose-same-document-transitionWhile.html
+++ b/app-history/per-entry-events/dispose-same-document-transitionWhile.html
@@ -11,8 +11,8 @@
location.hash = "#2";
location.hash = "#3";
- assert_equals(appHistory.entries().length, 4);
- const [entry0, entry1, entry2, entry3] = appHistory.entries();
+ assert_equals(navigation.entries().length, 4);
+ const [entry0, entry1, entry2, entry3] = navigation.entries();
assert_equals((new URL(entry2.url)).hash, "#2");
assert_equals((new URL(entry3.url)).hash, "#3");
@@ -26,14 +26,14 @@
assert_equals(e.composed, false);
assert_array_equals(
- appHistory.entries(),
- [entry0, entry1, appHistory.current],
+ navigation.entries(),
+ [entry0, entry1, navigation.currentEntry],
"entries() is updated during dispose for entry 2");
- assert_not_equals(appHistory.current, entry1, "current entry must be updated during dispose for entry 3");
- assert_true(appHistory.canGoBack, "canGoBack is still true during dispose for entry 2");
- assert_false(appHistory.canGoForward, "canGoForward is still false during beforedispose for entry 2");
- assert_equals(appHistory.transition.navigationType, "push", "transition navigationType during dispose for entry 2");
- assert_equals(appHistory.transition.from, entry1, "transition from during dispose for entry 2");
+ assert_not_equals(navigation.currentEntry, entry1, "current entry must be updated during dispose for entry 3");
+ assert_true(navigation.canGoBack, "canGoBack is still true during dispose for entry 2");
+ assert_false(navigation.canGoForward, "canGoForward is still false during beforedispose for entry 2");
+ assert_equals(navigation.transition.navigationType, "push", "transition navigationType during dispose for entry 2");
+ assert_equals(navigation.transition.from, entry1, "transition from during dispose for entry 2");
assert_equals(location.hash, "#fork", "location.hash is updated during dispose for entry 2");
});
@@ -41,31 +41,31 @@
assert_true(dispose2Called, "dispose for entry 2 must have happened before entry 3");
assert_array_equals(
- appHistory.entries(),
- [entry0, entry1, appHistory.current],
+ navigation.entries(),
+ [entry0, entry1, navigation.currentEntry],
"entries() is updated during dispose for entry 3");
- assert_not_equals(appHistory.current, entry1, "current entry must be updated during dispose for entry 3");
- assert_true(appHistory.canGoBack, "canGoBack is still true during dispose for entry 3");
- assert_false(appHistory.canGoForward, "canGoForward is still false during beforedispose for entry 3");
- assert_equals(appHistory.transition.navigationType, "push", "transition navigationType during dispose for entry 3");
- assert_equals(appHistory.transition.from, entry1, "transition from during dispose for entry 3");
+ assert_not_equals(navigation.currentEntry, entry1, "current entry must be updated during dispose for entry 3");
+ assert_true(navigation.canGoBack, "canGoBack is still true during dispose for entry 3");
+ assert_false(navigation.canGoForward, "canGoForward is still false during beforedispose for entry 3");
+ assert_equals(navigation.transition.navigationType, "push", "transition navigationType during dispose for entry 3");
+ assert_equals(navigation.transition.from, entry1, "transition from during dispose for entry 3");
assert_equals(location.hash, "#fork", "location.hash is updated during dispose for entry 3");
}));
- await appHistory.goTo(entry1.key).committed;
+ await navigation.traverseTo(entry1.key).committed;
- appHistory.addEventListener("navigate", e => {
+ navigation.addEventListener("navigate", e => {
e.transitionWhile(Promise.resolve());
});
- appHistory.navigate("#fork");
+ navigation.navigate("#fork");
- assert_equals(appHistory.entries().length, 3);
- const [finalEntry0, finalEntry1, finalEntry2] = appHistory.entries();
+ assert_equals(navigation.entries().length, 3);
+ const [finalEntry0, finalEntry1, finalEntry2] = navigation.entries();
assert_equals(finalEntry0, entry0);
assert_equals(finalEntry1, entry1);
assert_not_equals(finalEntry2, entry2);
- assert_equals(appHistory.current, finalEntry2);
+ assert_equals(navigation.currentEntry, finalEntry2);
assert_equals((new URL(finalEntry2.url)).hash, "#fork");
}, "dispose events when forward-pruning same-document entries");
</script>
diff --git a/app-history/per-entry-events/dispose-same-document.html b/app-history/per-entry-events/dispose-same-document.html
index 85e1293..27806ce 100644
--- a/app-history/per-entry-events/dispose-same-document.html
+++ b/app-history/per-entry-events/dispose-same-document.html
@@ -11,8 +11,8 @@
location.hash = "#2";
location.hash = "#3";
- assert_equals(appHistory.entries().length, 4);
- const [entry0, entry1, entry2, entry3] = appHistory.entries();
+ assert_equals(navigation.entries().length, 4);
+ const [entry0, entry1, entry2, entry3] = navigation.entries();
assert_equals((new URL(entry2.url)).hash, "#2");
assert_equals((new URL(entry3.url)).hash, "#3");
@@ -26,13 +26,13 @@
assert_equals(e.composed, false);
assert_array_equals(
- appHistory.entries(),
- [entry0, entry1, appHistory.current],
+ navigation.entries(),
+ [entry0, entry1, navigation.currentEntry],
"entries() is updated during dispose for entry 2");
- assert_not_equals(appHistory.current, entry1, "current entry must be updated during dispose for entry 3");
- assert_true(appHistory.canGoBack, "canGoBack is still true during dispose for entry 2");
- assert_false(appHistory.canGoForward, "canGoForward is still false during beforedispose for entry 2");
- assert_equals(appHistory.transition, null, "transition during dispose for entry 2");
+ assert_not_equals(navigation.currentEntry, entry1, "current entry must be updated during dispose for entry 3");
+ assert_true(navigation.canGoBack, "canGoBack is still true during dispose for entry 2");
+ assert_false(navigation.canGoForward, "canGoForward is still false during beforedispose for entry 2");
+ assert_equals(navigation.transition, null, "transition during dispose for entry 2");
assert_equals(location.hash, "#fork", "location.hash is updated during dispose for entry 2");
});
@@ -40,26 +40,26 @@
assert_true(dispose2Called, "dispose for entry 2 must have happened before entry 3");
assert_array_equals(
- appHistory.entries(),
- [entry0, entry1, appHistory.current],
+ navigation.entries(),
+ [entry0, entry1, navigation.currentEntry],
"entries() is updated during dispose for entry 3");
- assert_not_equals(appHistory.current, entry1, "current entry must be updated during dispose for entry 3");
- assert_true(appHistory.canGoBack, "canGoBack is still true during dispose for entry 3");
- assert_false(appHistory.canGoForward, "canGoForward is still false during beforedispose for entry 3");
- assert_equals(appHistory.transition, null, "transition during dispose for entry 2");
+ assert_not_equals(navigation.currentEntry, entry1, "current entry must be updated during dispose for entry 3");
+ assert_true(navigation.canGoBack, "canGoBack is still true during dispose for entry 3");
+ assert_false(navigation.canGoForward, "canGoForward is still false during beforedispose for entry 3");
+ assert_equals(navigation.transition, null, "transition during dispose for entry 2");
assert_equals(location.hash, "#fork", "location.hash is updated during dispose for entry 3");
}));
- await appHistory.goTo(entry1.key).committed;
+ await navigation.traverseTo(entry1.key).committed;
- appHistory.navigate("#fork");
+ navigation.navigate("#fork");
- assert_equals(appHistory.entries().length, 3);
- const [finalEntry0, finalEntry1, finalEntry2] = appHistory.entries();
+ assert_equals(navigation.entries().length, 3);
+ const [finalEntry0, finalEntry1, finalEntry2] = navigation.entries();
assert_equals(finalEntry0, entry0);
assert_equals(finalEntry1, entry1);
assert_not_equals(finalEntry2, entry2);
- assert_equals(appHistory.current, finalEntry2);
+ assert_equals(navigation.currentEntry, finalEntry2);
assert_equals((new URL(finalEntry2.url)).hash, "#fork");
}, "dispose events when forward-pruning same-document entries");
</script>