summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html')
-rw-r--r--testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html b/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
new file mode 100644
index 0000000000..cebd2f3693
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<iframe id="i" src="/common/blank.html"></iframe>
+<script>
+promise_test(async t => {
+ // 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));
+
+ let target_key = i.contentWindow.navigation.currentEntry.key;
+ let target_id = i.contentWindow.navigation.currentEntry.id;
+ await i.contentWindow.navigation.navigate("#").finished;
+ assert_true(i.contentWindow.navigation.canGoBack);
+
+ i.contentWindow.navigation.onnavigate = e => {
+ assert_equals(e.navigationType, "traverse");
+ assert_false(e.cancelable, "traversals in iframes should never be cancelable");
+ assert_true(e.canIntercept);
+ assert_false(e.userInitiated);
+ assert_true(e.hashChange);
+ assert_equals(e.downloadRequest, null);
+ assert_equals(new URL(e.destination.url).hash, "");
+ assert_true(e.destination.sameDocument);
+ assert_equals(e.destination.key, target_key);
+ assert_equals(e.destination.id, target_id);
+ assert_equals(e.destination.index, 0);
+ assert_equals(e.formData, null);
+ assert_equals(e.info, "hi");
+ }
+ await i.contentWindow.navigation.back({ info: "hi" }).finished;
+}, "navigate event for navigation.back() - same-document in an iframe");
+</script>