summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html')
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html
new file mode 100644
index 0000000000..97918a1f99
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<!-- test must be run in a top level browsing context -->
+<title>window.name test helper</title>
+<script>
+const search = window.location.search.replace("?", "");
+const steps = search.split("|");
+
+async function proceedTest() {
+ while (steps.length) {
+ const step = steps.shift();
+
+ if (step.startsWith("report=")) {
+ const id = step.split("=")[1];
+ const stashURL = new URL("unset_context_name_stash.py", location);
+ stashURL.searchParams.set('id', id);
+ stashURL.searchParams.set('value', window.name);
+
+ await fetch(stashURL, { method: "POST" });
+ continue;
+ }
+
+ if (step === "close") {
+ window.close();
+ break;
+ }
+
+ if (step === "navigate") {
+ const url = new URL(window.location);
+ url.host = "{{hosts[][www]}}:{{ports[http][0]}}";
+ url.search = "?" + steps.join("|");
+ window.location = url.href;
+ break;
+ }
+
+ if (step.startsWith("set=")) {
+ window.name = step.split("=")[1];
+ continue;
+ }
+
+ throw new Error("Unsupported step!");
+ }
+}
+
+proceedTest();
+</script>