diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
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.html | 33 |
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> |