summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/navigation-api/navigate-event/resources
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/navigation-api/navigate-event/resources
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/navigation-api/navigate-event/resources')
-rw-r--r--testing/web-platform/tests/navigation-api/navigate-event/resources/cross-origin-redirect-on-second-visit.py31
-rw-r--r--testing/web-platform/tests/navigation-api/navigate-event/resources/meta-refresh.html4
-rw-r--r--testing/web-platform/tests/navigation-api/navigate-event/resources/navigatesuccess-cross-document-helper.html6
-rw-r--r--testing/web-platform/tests/navigation-api/navigate-event/resources/opener-postMessage-onload.html6
4 files changed, 47 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/resources/cross-origin-redirect-on-second-visit.py b/testing/web-platform/tests/navigation-api/navigate-event/resources/cross-origin-redirect-on-second-visit.py
new file mode 100644
index 0000000000..12a9427fb7
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigate-event/resources/cross-origin-redirect-on-second-visit.py
@@ -0,0 +1,31 @@
+import uuid
+
+def redirect_response():
+ location = b'http://localhost:8000/common/blank.html'
+ return (301,
+ [
+ (b'Cache-Control', b'no-cache, no-store, must-revalidate'),
+ (b'Pragma', b'no-cache'),
+ (b'Content-Type', b'text/html'),
+ (b'Location', location),
+ ],
+ b'redirect_body')
+
+def ok_response():
+ return (
+ [
+ (b'Cache-Control', b'no-cache, no-store, must-revalidate'),
+ (b'Pragma', b'no-cache'),
+ (b'Content-Type', b'text/html')
+ ],
+ b'body')
+
+def main(request, response):
+ key = request.GET[b'key'];
+ visited = request.server.stash.take(key)
+ request.server.stash.put(key, True)
+
+ if visited is None:
+ return ok_response()
+
+ return redirect_response()
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/resources/meta-refresh.html b/testing/web-platform/tests/navigation-api/navigate-event/resources/meta-refresh.html
new file mode 100644
index 0000000000..fd453e663f
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigate-event/resources/meta-refresh.html
@@ -0,0 +1,4 @@
+<head>
+<meta http-equiv="refresh" content="0"></meta>
+</head>
+<body></body>
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/resources/navigatesuccess-cross-document-helper.html b/testing/web-platform/tests/navigation-api/navigate-event/resources/navigatesuccess-cross-document-helper.html
new file mode 100644
index 0000000000..aabc5015a9
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigate-event/resources/navigatesuccess-cross-document-helper.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<head>
+<script>
+navigation.onnavigatesuccess = () => top.postMessage("navigatesuccess received");
+</script>
+</head>
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/resources/opener-postMessage-onload.html b/testing/web-platform/tests/navigation-api/navigate-event/resources/opener-postMessage-onload.html
new file mode 100644
index 0000000000..97e1d82058
--- /dev/null
+++ b/testing/web-platform/tests/navigation-api/navigate-event/resources/opener-postMessage-onload.html
@@ -0,0 +1,6 @@
+<!doctype html>
+<head>
+<script>
+window.onload = () => opener.postMessage("onload", "*");
+</script>
+</head>