summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html
parentInitial commit. (diff)
downloadthunderbird-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/navigation-history-entry/entries-across-origins.html')
-rw-r--r--testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html b/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html
new file mode 100644
index 0000000000..447273bff2
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigation-history-entry/entries-across-origins.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="resources/is_uuid.js"></script>
+<iframe id="i" src="/common/blank.html"></iframe>
+<script>
+async_test(t => {
+ window.onload = t.step_func(() => {
+ 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;
+ i.contentWindow.location.assign(cross_origin_url.href);
+
+ window.onmessage = t.step_func(e => {
+ assert_equals(e.data, 1);
+
+ i.src = "/common/blank.html?2";
+ i.onload = t.step_func_done(() => {
+ 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);
+ assert_not_equals(entries[0].id, start_id);
+ assert_true(isUUID(entries[0].key));
+ assert_true(isUUID(entries[0].id));
+ });
+ });
+ });
+}, "navigation.entries() should only contain entries that are both same-origin and contiguous");
+</script>