App history: rename respondWith() to transitionWhile()
... and canRespond to canTransition.
Follows https://github.com/WICG/app-history/pull/151.
Bug: 1183545
Change-Id: Ide039a88cb9a40688a0fff99ff8b3a954a12faaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3100807
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#912818}
diff --git a/app-history/navigate-event/event-constructor.html b/app-history/navigate-event/event-constructor.html
index d512abf..f580e77 100644
--- a/app-history/navigate-event/event-constructor.html
+++ b/app-history/navigate-event/event-constructor.html
@@ -6,7 +6,7 @@
assert_throws_js(TypeError, () => {
new AppHistoryNavigateEvent("navigate", {
navigationType: "push",
- canRespond: false,
+ canTransition: false,
userInitiated: false,
hashChange: false,
signal: (new AbortController()).signal,
@@ -23,7 +23,7 @@
new AppHistoryNavigateEvent("navigate", {
navigationType: "push",
destination: e.destination,
- canRespond: false,
+ canTransition: false,
userInitiated: false,
hashChange: false,
formData: null,
@@ -44,7 +44,7 @@
const event = new AppHistoryNavigateEvent("navigate", {
navigationType: "replace",
destination: e.destination,
- canRespond: true,
+ canTransition: true,
userInitiated: true,
hashChange: true,
signal,
@@ -54,7 +54,7 @@
assert_equals(event.navigationType, "replace");
assert_equals(event.destination, e.destination);
- assert_equals(event.canRespond, true);
+ assert_equals(event.canTransition, true);
assert_equals(event.userInitiated, true);
assert_equals(event.hashChange, true);
assert_equals(event.signal, signal);
@@ -73,7 +73,7 @@
});
assert_equals(event.navigationType, "push");
- assert_equals(event.canRespond, false);
+ assert_equals(event.canTransition, false);
assert_equals(event.userInitiated, false);
assert_equals(event.hashChange, false);
assert_equals(event.formData, null);
diff --git a/app-history/navigate-event/navigate-anchor-cross-origin.html b/app-history/navigate-event/navigate-anchor-cross-origin.html
index 987c20f..a6d395a 100644
--- a/app-history/navigate-event/navigate-anchor-cross-origin.html
+++ b/app-history/navigate-event/navigate-anchor-cross-origin.html
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_false(e.canRespond);
+ assert_false(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.formData, null);
diff --git a/app-history/navigate-event/navigate-anchor-fragment.html b/app-history/navigate-event/navigate-anchor-fragment.html
index ff59fa2..77cf94a 100644
--- a/app-history/navigate-event/navigate-anchor-fragment.html
+++ b/app-history/navigate-event/navigate-anchor-fragment.html
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(e.formData, null);
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 766f897..ac8f548 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
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.formData, null);
diff --git a/app-history/navigate-event/navigate-anchor-userInitiated.html b/app-history/navigate-event/navigate-anchor-userInitiated.html
index de2694c..8afe01d 100644
--- a/app-history/navigate-event/navigate-anchor-userInitiated.html
+++ b/app-history/navigate-event/navigate-anchor-userInitiated.html
@@ -10,7 +10,7 @@
appHistory.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_true(e.userInitiated);
assert_true(e.hashChange);
assert_equals(e.formData, null);
diff --git a/app-history/navigate-event/navigate-anchor-with-target.html b/app-history/navigate-event/navigate-anchor-with-target.html
index af2c6d9..cf69358 100644
--- a/app-history/navigate-event/navigate-anchor-with-target.html
+++ b/app-history/navigate-event/navigate-anchor-with-target.html
@@ -12,7 +12,7 @@
iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.formData, null);
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 ae3db6f..da68ea4 100644
--- a/app-history/navigate-event/navigate-appHistory-back-cross-document.html
+++ b/app-history/navigate-event/navigate-appHistory-back-cross-document.html
@@ -12,7 +12,7 @@
i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_true(e.cancelable);
- assert_false(e.canRespond);
+ assert_false(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).pathname, "/common/blank.html");
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 e201e41..c39fc7b 100644
--- a/app-history/navigate-event/navigate-appHistory-back-same-document.html
+++ b/app-history/navigate-event/navigate-appHistory-back-same-document.html
@@ -12,7 +12,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "");
diff --git a/app-history/navigate-event/navigate-appHistory-navigate.html b/app-history/navigate-event/navigate-appHistory-navigate.html
index 692f08b..b48e816 100644
--- a/app-history/navigate-event/navigate-appHistory-navigate.html
+++ b/app-history/navigate-event/navigate-appHistory-navigate.html
@@ -6,7 +6,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#foo");
diff --git a/app-history/navigate-event/navigate-cross-origin-iframe-location.html b/app-history/navigate-event/navigate-cross-origin-iframe-location.html
index 55fc53b..58e0916 100644
--- a/app-history/navigate-event/navigate-cross-origin-iframe-location.html
+++ b/app-history/navigate-event/navigate-cross-origin-iframe-location.html
@@ -12,7 +12,7 @@
document.body.appendChild(iframe);
window.onmessage = t.step_func_done(e => {
- assert_equals(e.data, "cancelable,canRespond,hashChange,");
+ assert_equals(e.data, "cancelable,canTransition,hashChange,");
});
appHistory.onnavigate = t.step_func_done(() => {
diff --git a/app-history/navigate-event/navigate-form-get.html b/app-history/navigate-event/navigate-form-get.html
index 3f6976d..8438491 100644
--- a/app-history/navigate-event/navigate-form-get.html
+++ b/app-history/navigate-event/navigate-form-get.html
@@ -9,7 +9,7 @@
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.destination.url, location.href + "?");
diff --git a/app-history/navigate-event/navigate-form-userInitiated.html b/app-history/navigate-event/navigate-form-userInitiated.html
index c7a2553..e1c8c28 100644
--- a/app-history/navigate-event/navigate-form-userInitiated.html
+++ b/app-history/navigate-event/navigate-form-userInitiated.html
@@ -14,7 +14,7 @@
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_true(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.destination.url, location.href);
diff --git a/app-history/navigate-event/navigate-form-with-target.html b/app-history/navigate-event/navigate-form-with-target.html
index f50bbd6..dcbbdc0 100644
--- a/app-history/navigate-event/navigate-form-with-target.html
+++ b/app-history/navigate-event/navigate-form-with-target.html
@@ -11,7 +11,7 @@
iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).pathname,
diff --git a/app-history/navigate-event/navigate-form.html b/app-history/navigate-event/navigate-form.html
index 0b7d644..8413c48 100644
--- a/app-history/navigate-event/navigate-form.html
+++ b/app-history/navigate-event/navigate-form.html
@@ -9,7 +9,7 @@
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.destination.url, location.href);
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 1153b0b..54791d8 100644
--- a/app-history/navigate-event/navigate-history-back-after-fragment.html
+++ b/app-history/navigate-event/navigate-history-back-after-fragment.html
@@ -13,7 +13,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "");
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 81c7fc2..3d94855 100644
--- a/app-history/navigate-event/navigate-history-back-after-pushState.html
+++ b/app-history/navigate-event/navigate-history-back-after-pushState.html
@@ -13,7 +13,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "traverse");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "");
diff --git a/app-history/navigate-event/navigate-history-go-0.html b/app-history/navigate-event/navigate-history-go-0.html
index 8cac53b..2070614 100644
--- a/app-history/navigate-event/navigate-history-go-0.html
+++ b/app-history/navigate-event/navigate-history-go-0.html
@@ -8,7 +8,7 @@
i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "reload");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).pathname, "/common/blank.html");
diff --git a/app-history/navigate-event/navigate-history-pushState.html b/app-history/navigate-event/navigate-history-pushState.html
index fd3969f..b7940f1 100644
--- a/app-history/navigate-event/navigate-history-pushState.html
+++ b/app-history/navigate-event/navigate-history-pushState.html
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigate-history-replaceState.html b/app-history/navigate-event/navigate-history-replaceState.html
index 46511ca..dda602d 100644
--- a/app-history/navigate-event/navigate-history-replaceState.html
+++ b/app-history/navigate-event/navigate-history-replaceState.html
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigate-iframe-location.html b/app-history/navigate-event/navigate-iframe-location.html
index 4f8b501..8abaabb 100644
--- a/app-history/navigate-event/navigate-iframe-location.html
+++ b/app-history/navigate-event/navigate-iframe-location.html
@@ -11,7 +11,7 @@
iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigate-location.html b/app-history/navigate-event/navigate-location.html
index 2d9a90d..ec17dcf 100644
--- a/app-history/navigate-event/navigate-location.html
+++ b/app-history/navigate-event/navigate-location.html
@@ -7,7 +7,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "replace");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigate-meta-refresh.html b/app-history/navigate-event/navigate-meta-refresh.html
index d7c0716..4f3769d 100644
--- a/app-history/navigate-event/navigate-meta-refresh.html
+++ b/app-history/navigate-event/navigate-meta-refresh.html
@@ -10,7 +10,7 @@
i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "reload");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
assert_equals(e.destination.url, i.contentWindow.location.href);
diff --git a/app-history/navigate-event/navigate-window-open-self.html b/app-history/navigate-event/navigate-window-open-self.html
index cbdd242..1523ed8 100644
--- a/app-history/navigate-event/navigate-window-open-self.html
+++ b/app-history/navigate-event/navigate-window-open-self.html
@@ -6,7 +6,7 @@
appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigate-window-open.html b/app-history/navigate-event/navigate-window-open.html
index c72ebd5..03cd14e 100644
--- a/app-history/navigate-event/navigate-window-open.html
+++ b/app-history/navigate-event/navigate-window-open.html
@@ -11,7 +11,7 @@
iframe.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_true(e.hashChange);
assert_equals(new URL(e.destination.url).hash, "#1");
diff --git a/app-history/navigate-event/navigateerror-ordering-location-api-reentrant.html b/app-history/navigate-event/navigateerror-ordering-location-api-reentrant.html
index f81a901..435690f 100644
--- a/app-history/navigate-event/navigateerror-ordering-location-api-reentrant.html
+++ b/app-history/navigate-event/navigateerror-ordering-location-api-reentrant.html
@@ -15,7 +15,7 @@
appHistory.onnavigate = t.step_func(e => {
events.push("navigate");
e.signal.onabort = () => events.push("abort");
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
if (first_onnavigate) {
first_onnavigate = false;
location.hash = "#2";
diff --git a/app-history/navigate-event/navigateerror-ordering-location-api.html b/app-history/navigate-event/navigateerror-ordering-location-api.html
index bb9a63e..92b76ad 100644
--- a/app-history/navigate-event/navigateerror-ordering-location-api.html
+++ b/app-history/navigate-event/navigateerror-ordering-location-api.html
@@ -14,7 +14,7 @@
appHistory.onnavigate = t.step_func(e => {
events.push("navigate");
e.signal.onabort = () => events.push("abort");
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
});
location.hash = "#1";
location.hash = "#2";
diff --git a/app-history/navigate-event/navigateerror-ordering-respondWith-reentrant.html b/app-history/navigate-event/navigateerror-ordering-transitionWhile-reentrant.html
similarity index 91%
rename from app-history/navigate-event/navigateerror-ordering-respondWith-reentrant.html
rename to app-history/navigate-event/navigateerror-ordering-transitionWhile-reentrant.html
index ba48847..369a961 100644
--- a/app-history/navigate-event/navigateerror-ordering-respondWith-reentrant.html
+++ b/app-history/navigate-event/navigateerror-ordering-transitionWhile-reentrant.html
@@ -17,7 +17,7 @@
assert_equals(location.href, start_href);
events.push("navigate");
e.signal.onabort = () => events.push("abort");
- e.respondWith(new Promise(resolve => t.step_timeout(resolve, 2)));
+ e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
if (first_onnavigate) {
first_onnavigate = false;
p2 = appHistory.navigate("#2").then(() => events.push("p2_fulfill"));
@@ -30,5 +30,5 @@
await p1;
await p2;
assert_array_equals(events, ["navigate", "abort", "navigateerror", "navigate", "p1_reject", "navigatesuccess", "p2_fulfill"]);
-}, "navigateerror ordering when navigate() is called reentrantly and handled by respondWith()");
+}, "navigateerror ordering when navigate() is called reentrantly and handled by transitionWhile()");
</script>
diff --git a/app-history/navigate-event/navigateerror-ordering-respondWith.html b/app-history/navigate-event/navigateerror-ordering-transitionWhile.html
similarity index 90%
rename from app-history/navigate-event/navigateerror-ordering-respondWith.html
rename to app-history/navigate-event/navigateerror-ordering-transitionWhile.html
index 745de85..b4b6586 100644
--- a/app-history/navigate-event/navigateerror-ordering-respondWith.html
+++ b/app-history/navigate-event/navigateerror-ordering-transitionWhile.html
@@ -14,12 +14,12 @@
appHistory.onnavigate = t.step_func(e => {
events.push("navigate");
e.signal.onabort = () => events.push("onabort");
- e.respondWith(new Promise(resolve => t.step_timeout(resolve, 2)));
+ e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
});
const p1 = promise_rejects_dom(t, 'AbortError', appHistory.navigate("#1")).then(() => events.push("p1_reject"));
await appHistory.navigate("#2").then(() => events.push("p2_fulfill"));
await p1;
assert_equals(location.hash, "#2");
assert_array_equals(events, ["navigate", "onabort", "onnavigateerror", "navigate", "p1_reject", "onnavigatesuccess", "p2_fulfill"]);
-}, "navigateerror ordering when navigate() is called repeatedly and handled by respondWith()");
+}, "navigateerror ordering when navigate() is called repeatedly and handled by transitionWhile()");
</script>
diff --git a/app-history/navigate-event/resources/cross-origin-iframe-helper.html b/app-history/navigate-event/resources/cross-origin-iframe-helper.html
index bbb2de4..95b3ce3 100644
--- a/app-history/navigate-event/resources/cross-origin-iframe-helper.html
+++ b/app-history/navigate-event/resources/cross-origin-iframe-helper.html
@@ -3,8 +3,8 @@
let message = "";
if (e.cancelable)
message += "cancelable,";
- if (e.canRespond)
- message += "canRespond,";
+ if (e.canTransition)
+ message += "canTransition,";
if (e.userInitiated)
message += "userInitiated,";
if (e.hashChange)
diff --git a/app-history/navigate-event/signal-abort-respondWith.html b/app-history/navigate-event/signal-abort-transitionWhile.html
similarity index 76%
rename from app-history/navigate-event/signal-abort-respondWith.html
rename to app-history/navigate-event/signal-abort-transitionWhile.html
index fc058c7..4d8be52 100644
--- a/app-history/navigate-event/signal-abort-respondWith.html
+++ b/app-history/navigate-event/signal-abort-transitionWhile.html
@@ -8,11 +8,11 @@
appHistory.onnavigate = t.step_func(e => {
abort_signal = e.signal;
abort_signal.onabort = () => onabort_called = true;
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
});
await appHistory.navigate("?1");
assert_false(abort_signal.aborted);
assert_false(onabort_called);
-}, "AppHistoryNavigateEvent.respondWith does not signal AppHistoryNavigateEvent.signal");
+}, "AppHistoryNavigateEvent's transitionWhile() does not signal AppHistoryNavigateEvent's signal");
</script>
diff --git a/app-history/navigate-event/signal-abort-window-stop-after-respondWith.html b/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html
similarity index 86%
rename from app-history/navigate-event/signal-abort-window-stop-after-respondWith.html
rename to app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html
index 83b7254..365b736 100644
--- a/app-history/navigate-event/signal-abort-window-stop-after-respondWith.html
+++ b/app-history/navigate-event/signal-abort-window-stop-after-transitionWhile.html
@@ -19,7 +19,7 @@
appHistory.onnavigate = t.step_func(e => {
abort_signal = e.signal;
abort_signal.onabort = () => onabort_called = true;
- e.respondWith(new Promise(resolve => t.step_timeout(resolve, 0)));
+ e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 0)));
});
let navigate_promise = appHistory.navigate("?1");
window.stop();
@@ -33,5 +33,5 @@
t.step_timeout(t.step_func_done(() => {}), 5);
});
});
-}, "window.stop() cancels AppHistoryNavigateEvent.respondWith and signals AppHistoryNavigateEvent.signal");
+}, "window.stop() cancels AppHistoryNavigateEvent's transitionWhile() and signals AppHistoryNavigateEvent's signal");
</script>
diff --git a/app-history/navigate-event/respondWith-appHistory-back.html b/app-history/navigate-event/transitionWhile-appHistory-back.html
similarity index 78%
rename from app-history/navigate-event/respondWith-appHistory-back.html
rename to app-history/navigate-event/transitionWhile-appHistory-back.html
index ed0efba..087d55c 100644
--- a/app-history/navigate-event/respondWith-appHistory-back.html
+++ b/app-history/navigate-event/transitionWhile-appHistory-back.html
@@ -8,12 +8,12 @@
window.onload = () => t.step_timeout(() => {
appHistory.navigate("#foo").then(() => {
assert_true(appHistory.canGoBack);
- appHistory.onnavigate = t.step_func(e => e.respondWith(Promise.resolve()));
+ appHistory.onnavigate = t.step_func(e => e.transitionWhile(Promise.resolve()));
appHistory.back().then(t.step_func_done(() => {
assert_equals(appHistory.entries().length, 2);
assert_equals(appHistory.current, appHistory.entries()[0]);
}));
});
}, 0);
-}, "AppHistoryNavigateEvent.respondWith can intercept appHistory.back()");
+}, "AppHistoryNavigateEvent's transitionWhile() can intercept appHistory.back()");
</script>
diff --git a/app-history/navigate-event/respondWith-cross-document-same-origin.html b/app-history/navigate-event/transitionWhile-cross-document-same-origin.html
similarity index 75%
rename from app-history/navigate-event/respondWith-cross-document-same-origin.html
rename to app-history/navigate-event/transitionWhile-cross-document-same-origin.html
index a481a09..249641d 100644
--- a/app-history/navigate-event/respondWith-cross-document-same-origin.html
+++ b/app-history/navigate-event/transitionWhile-cross-document-same-origin.html
@@ -7,13 +7,13 @@
let target_url = location.href + "?1";
appHistory.onnavigate = t.step_func_done(e => {
assert_true(e.cancelable);
- assert_true(e.canRespond);
+ assert_true(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
- e.respondWith(Promise.resolve().then(
+ e.transitionWhile(Promise.resolve().then(
t.step_func_done(() => assert_equals(location.href, target_url))));
});
window.onload = t.step_func(() => location.href = target_url);
-}, "AppHistoryNavigateEvent.respondWith intercepts a same-origin cross-document navigation");
+}, "AppHistoryNavigateEvent's transitionWhile() intercepts a same-origin cross-document navigation");
</script>
diff --git a/app-history/navigate-event/respondWith-cross-origin.html b/app-history/navigate-event/transitionWhile-cross-origin.html
similarity index 68%
rename from app-history/navigate-event/respondWith-cross-origin.html
rename to app-history/navigate-event/transitionWhile-cross-origin.html
index ee29f28..d828c5c 100644
--- a/app-history/navigate-event/respondWith-cross-origin.html
+++ b/app-history/navigate-event/transitionWhile-cross-origin.html
@@ -6,13 +6,13 @@
async_test(t => {
appHistory.onnavigate = t.step_func_done(e => {
assert_true(e.cancelable);
- assert_false(e.canRespond);
+ assert_false(e.canTransition);
assert_false(e.userInitiated);
assert_false(e.hashChange);
- assert_throws_dom("SecurityError", () => e.respondWith(Promise.resolve()));
+ assert_throws_dom("SecurityError", () => e.transitionWhile(Promise.resolve()));
e.preventDefault();
});
window.onload = t.step_func(() => location.href = get_host_info().HTTPS_REMOTE_ORIGIN);
-}, "AppHistoryNavigateEvent.respondWith should throw if called for a cross origin navigation");
+}, "AppHistoryNavigateEvent's transitionWhile() should throw if called for a cross origin navigation");
</script>
diff --git a/app-history/navigate-event/respondWith-detach.html b/app-history/navigate-event/transitionWhile-detach.html
similarity index 91%
rename from app-history/navigate-event/respondWith-detach.html
rename to app-history/navigate-event/transitionWhile-detach.html
index 1626857..3b1f88f 100644
--- a/app-history/navigate-event/respondWith-detach.html
+++ b/app-history/navigate-event/transitionWhile-detach.html
@@ -8,7 +8,7 @@
i.contentWindow.appHistory.onnavigate = t.step_func_done(e => {
let iframe_constructor = i.contentWindow.DOMException;
i.remove();
- assert_throws_dom("InvalidStateError", iframe_constructor, () => e.respondWith(Promise.resolve()));
+ assert_throws_dom("InvalidStateError", iframe_constructor, () => e.transitionWhile(Promise.resolve()));
});
i.contentWindow.location.href = "#1";
diff --git a/app-history/navigate-event/respondWith-history-pushState.html b/app-history/navigate-event/transitionWhile-history-pushState.html
similarity index 80%
rename from app-history/navigate-event/respondWith-history-pushState.html
rename to app-history/navigate-event/transitionWhile-history-pushState.html
index 4906229..81da433 100644
--- a/app-history/navigate-event/respondWith-history-pushState.html
+++ b/app-history/navigate-event/transitionWhile-history-pushState.html
@@ -5,7 +5,7 @@
async_test(t => {
let start_length = history.length;
appHistory.onnavigate = t.step_func(e => {
- e.respondWith(new Promise(resolve => t.step_timeout(() => {
+ e.transitionWhile(new Promise(resolve => t.step_timeout(() => {
resolve();
t.step_timeout(t.step_func_done(() => {
assert_equals(location.hash, "#1");
@@ -19,5 +19,5 @@
assert_equals(location.hash, "#1");
assert_equals(history.state, "update");
assert_equals(history.length, start_length + 1);
-}, "AppHistoryNavigateEvent.respondWith should proceed if the given promise resolves");
+}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves");
</script>
diff --git a/app-history/navigate-event/respondWith-history-replaceState.html b/app-history/navigate-event/transitionWhile-history-replaceState.html
similarity index 79%
rename from app-history/navigate-event/respondWith-history-replaceState.html
rename to app-history/navigate-event/transitionWhile-history-replaceState.html
index b42d4dc..41c4949 100644
--- a/app-history/navigate-event/respondWith-history-replaceState.html
+++ b/app-history/navigate-event/transitionWhile-history-replaceState.html
@@ -5,7 +5,7 @@
async_test(t => {
let start_length = history.length;
appHistory.onnavigate = t.step_func(e => {
- e.respondWith(new Promise(resolve => t.step_timeout(() => {
+ e.transitionWhile(new Promise(resolve => t.step_timeout(() => {
resolve();
t.step_timeout(t.step_func_done(() => {
assert_equals(location.hash, "#1");
@@ -19,5 +19,5 @@
assert_equals(location.hash, "#1");
assert_equals(history.state, "update");
assert_equals(history.length, start_length);
-}, "AppHistoryNavigateEvent.respondWith should proceed if the given promise resolves");
+}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves");
</script>
diff --git a/app-history/navigate-event/respondWith-multiple-times-reject.html b/app-history/navigate-event/transitionWhile-multiple-times-reject.html
similarity index 76%
rename from app-history/navigate-event/respondWith-multiple-times-reject.html
rename to app-history/navigate-event/transitionWhile-multiple-times-reject.html
index 0e1bd19..f3f10d5 100644
--- a/app-history/navigate-event/respondWith-multiple-times-reject.html
+++ b/app-history/navigate-event/transitionWhile-multiple-times-reject.html
@@ -20,9 +20,9 @@
assert_greater_than(e.lineno, 0);
});
appHistory.onnavigate = t.step_func(e => {
- e.respondWith(Promise.resolve());
- e.respondWith(new Promise((resolve, reject) => t.step_timeout(() => reject(err), 1)));
- e.respondWith(new Promise(resolve => t.step_timeout(resolve, 1)));
+ 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").catch(t.step_func(e => {
@@ -31,5 +31,5 @@
}));
assert_true(onnavigateerror_called);
assert_true(caught_rejection);
-}, "AppHistoryNavigateEvent.respondWith is called multiple times and one of the promises rejects");
+}, "AppHistoryNavigateEvent's transitionWhile() is called multiple times and one of the promises rejects");
</script>
diff --git a/app-history/navigate-event/respondWith-multiple-times.html b/app-history/navigate-event/transitionWhile-multiple-times.html
similarity index 87%
rename from app-history/navigate-event/respondWith-multiple-times.html
rename to app-history/navigate-event/transitionWhile-multiple-times.html
index 5ca6db0..d0f9506 100644
--- a/app-history/navigate-event/respondWith-multiple-times.html
+++ b/app-history/navigate-event/transitionWhile-multiple-times.html
@@ -22,9 +22,9 @@
assert_true(p2_resolved);
p3_resolved = true;
}));
- e.respondWith(p1);
- e.respondWith(p2);
- e.respondWith(p3);
+ e.transitionWhile(p1);
+ e.transitionWhile(p2);
+ e.transitionWhile(p3);
});
let promise = appHistory.navigate("#1");
@@ -37,5 +37,5 @@
assert_true(p1_resolved);
assert_true(p2_resolved);
assert_true(p3_resolved);
-}, "appHistory.navigate() returns a promise that awaits all promises if AppHistoryNavigateEvent.respondWith is called multiple times");
+}, "appHistory.navigate() returns a promise that awaits all promises if AppHistoryNavigateEvent's transitionWhile() is called multiple times");
</script>
diff --git a/app-history/navigate-event/respondWith-on-synthetic-event.html b/app-history/navigate-event/transitionWhile-on-synthetic-event.html
similarity index 60%
rename from app-history/navigate-event/respondWith-on-synthetic-event.html
rename to app-history/navigate-event/transitionWhile-on-synthetic-event.html
index bfdd6a8..d912e38 100644
--- a/app-history/navigate-event/respondWith-on-synthetic-event.html
+++ b/app-history/navigate-event/transitionWhile-on-synthetic-event.html
@@ -3,6 +3,6 @@
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
- assert_throws_dom("SecurityError", () => new AppHistoryNavigateEvent("navigate").respondWith(Promise.resolve()));
-}, "AppHistoryNavigateEvent.respondWith throws if invoked on a synthetic event");
+ assert_throws_dom("SecurityError", () => new AppHistoryNavigateEvent("navigate").transitionWhile(Promise.resolve()));
+}, "AppHistoryNavigateEvent's transitionWhile() throws if invoked on a synthetic event");
</script>
diff --git a/app-history/navigate-event/respondWith-reject.html b/app-history/navigate-event/transitionWhile-reject.html
similarity index 80%
rename from app-history/navigate-event/respondWith-reject.html
rename to app-history/navigate-event/transitionWhile-reject.html
index 5340d87..33e0214 100644
--- a/app-history/navigate-event/respondWith-reject.html
+++ b/app-history/navigate-event/transitionWhile-reject.html
@@ -17,10 +17,10 @@
assert_greater_than(e.lineno, 0);
});
appHistory.onnavigate = e => {
- e.respondWith(new Promise((resolve, reject) => t.step_timeout(() => reject(err), 0)));
+ e.transitionWhile(new Promise((resolve, reject) => t.step_timeout(() => reject(err), 0)));
};
location.href = "#1";
assert_equals(location.hash, "#1");
-}, "AppHistoryNavigateEvent.respondWith should abort if the given promise rejects");
+}, "AppHistoryNavigateEvent's transitionWhile() should abort if the given promise rejects");
</script>
diff --git a/app-history/navigate-event/respondWith-resolve.html b/app-history/navigate-event/transitionWhile-resolve.html
similarity index 75%
rename from app-history/navigate-event/respondWith-resolve.html
rename to app-history/navigate-event/transitionWhile-resolve.html
index 6bc0875..32a47ec 100644
--- a/app-history/navigate-event/respondWith-resolve.html
+++ b/app-history/navigate-event/transitionWhile-resolve.html
@@ -11,10 +11,10 @@
});
appHistory.onnavigateerror = t.step_func_done(assert_unreached);
appHistory.onnavigate = e => {
- e.respondWith(new Promise(resolve => t.step_timeout(resolve, 0)));
+ e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 0)));
};
location.href = "#1";
assert_equals(location.hash, "#1");
-}, "AppHistoryNavigateEvent.respondWith should proceed if the given promise resolves");
+}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves");
</script>
diff --git a/app-history/navigate-event/respondWith-same-document-history-back.html b/app-history/navigate-event/transitionWhile-same-document-history-back.html
similarity index 90%
rename from app-history/navigate-event/respondWith-same-document-history-back.html
rename to app-history/navigate-event/transitionWhile-same-document-history-back.html
index ae69cba..18ae11e 100644
--- a/app-history/navigate-event/respondWith-same-document-history-back.html
+++ b/app-history/navigate-event/transitionWhile-same-document-history-back.html
@@ -10,7 +10,7 @@
let onnavigatesuccess_calls = 0;
appHistory.onnavigate = e => {
onnavigate_calls++;
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
}
appHistory.onnavigatesuccess = t.step_func(e => {
onnavigatesuccess_calls++;
@@ -36,5 +36,5 @@
history.back();
}));
}, 0);
-}, "AppHistoryNavigateEvent.respondWith can intercept same-document history.back()");
+}, "AppHistoryNavigateEvent's transitionWhile() can intercept same-document history.back()");
</script>
diff --git a/app-history/navigate/navigate-respondWith-history-state.html b/app-history/navigate/navigate-transitionWhile-history-state.html
similarity index 73%
rename from app-history/navigate/navigate-respondWith-history-state.html
rename to app-history/navigate/navigate-transitionWhile-history-state.html
index c7e64b5..67c2924 100644
--- a/app-history/navigate/navigate-respondWith-history-state.html
+++ b/app-history/navigate/navigate-transitionWhile-history-state.html
@@ -6,10 +6,10 @@
history.replaceState("state1", "", "#1");
assert_equals(history.state, "state1");
- appHistory.onnavigate = e => e.respondWith(Promise.resolve("r"));
+ appHistory.onnavigate = e => e.transitionWhile(Promise.resolve("r"));
let result = await appHistory.navigate("#2");
assert_equals(result, undefined);
assert_equals(location.hash, "#2");
assert_equals(history.state, null);
-}, "history.story should be nulled by navigate() handled by respondWith()");
+}, "history.story should be nulled by navigate() handled by transitionWhile()");
</script>
diff --git a/app-history/navigate/navigate-respondWith-reject-event-order.html b/app-history/navigate/navigate-transitionWhile-reject-event-order.html
similarity index 95%
rename from app-history/navigate/navigate-respondWith-reject-event-order.html
rename to app-history/navigate/navigate-transitionWhile-reject-event-order.html
index 327b1b4..1dc01fc 100644
--- a/app-history/navigate/navigate-respondWith-reject-event-order.html
+++ b/app-history/navigate/navigate-transitionWhile-reject-event-order.html
@@ -11,7 +11,7 @@
appHistory.onnavigate = e => {
events.push("onnavigate");
- e.respondWith(Promise.reject());
+ e.transitionWhile(Promise.reject());
};
appHistory.onnavigatesuccess = () => events.push("onnavigatesuccess");
appHistory.onnavigateerror = () => events.push("onnavigateerror");
diff --git a/app-history/navigate/navigate-respondWith-reject.html b/app-history/navigate/navigate-transitionWhile-reject.html
similarity index 77%
rename from app-history/navigate/navigate-respondWith-reject.html
rename to app-history/navigate/navigate-transitionWhile-reject.html
index d214f31..8ec5a9c 100644
--- a/app-history/navigate/navigate-respondWith-reject.html
+++ b/app-history/navigate/navigate-transitionWhile-reject.html
@@ -5,9 +5,9 @@
promise_test(async t => {
let promise_value = { abc: 'def' };
let promise = Promise.reject(promise_value);
- appHistory.onnavigate = e => e.respondWith(promise);
+ appHistory.onnavigate = e => e.transitionWhile(promise);
let returned_promise = appHistory.navigate("#1");
assert_not_equals(promise, returned_promise);
return promise_rejects_exactly(t, promise_value, returned_promise);
-}, "navigate() and respondWith with a reject promise");
+}, "navigate() and transitionWhile() with a rejected promise");
</script>
diff --git a/app-history/navigate/navigate-respondWith.html b/app-history/navigate/navigate-transitionWhile.html
similarity index 77%
rename from app-history/navigate/navigate-respondWith.html
rename to app-history/navigate/navigate-transitionWhile.html
index c65da90..f053c2b 100644
--- a/app-history/navigate/navigate-respondWith.html
+++ b/app-history/navigate/navigate-transitionWhile.html
@@ -5,10 +5,10 @@
promise_test(async () => {
let promise_value = { abc: 'def' };
let promise = Promise.resolve(promise_value);
- appHistory.onnavigate = e => e.respondWith(promise);
+ appHistory.onnavigate = e => e.transitionWhile(promise);
let returned_promise = appHistory.navigate("#1");
assert_not_equals(promise, returned_promise);
let result = await returned_promise;
assert_equals(result, undefined);
-}, "navigate() and respondWith");
+}, "navigate() and transitionWhile() with a fulfilled promise");
</script>
diff --git a/app-history/navigate/reload-state-and-info.html b/app-history/navigate/reload-state-and-info.html
index de395bb..17a24cd 100644
--- a/app-history/navigate/reload-state-and-info.html
+++ b/app-history/navigate/reload-state-and-info.html
@@ -19,7 +19,7 @@
let onnavigate_called = false;
let promise_settled = false;
i.contentWindow.appHistory.onnavigate = t.step_func(e => {
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
onnavigate_called = true;
assert_equals(e.info, navInfo);
assert_equals(e.navigationType, "reload");
diff --git a/app-history/navigate/reload-state-undefined.html b/app-history/navigate/reload-state-undefined.html
index 18b48ba..815b7bb 100644
--- a/app-history/navigate/reload-state-undefined.html
+++ b/app-history/navigate/reload-state-undefined.html
@@ -18,7 +18,7 @@
let onnavigate_called = false;
let promise_settled = false;
i.contentWindow.appHistory.onnavigate = t.step_func(e => {
- e.respondWith(Promise.resolve());
+ e.transitionWhile(Promise.resolve());
onnavigate_called = true;
assert_equals(e.info, navInfo);
assert_equals(e.navigationType, "reload");
diff --git a/app-history/navigate/resources/fetch-event-test-worker.js b/app-history/navigate/resources/fetch-event-test-worker.js
index e0d740a..98b7dd0 100644
--- a/app-history/navigate/resources/fetch-event-test-worker.js
+++ b/app-history/navigate/resources/fetch-event-test-worker.js
@@ -3,5 +3,5 @@
const body =
`method = ${request.method}, ` +
`isReloadNavigation = ${request.isReloadNavigation}`;
- event.respondWith(new Response(body));
+ event.transitionWhile(new Response(body));
});