diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py index 733d36b15edcd..c971f8d413b2f 100644 --- a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py @@ -24,9 +24,15 @@ def main(request, response): start_on = query.get("startOn") start_on_s = f"'{start_on[0]}'" if start_on else "null" + headers = [("Content-Type", "text/html")] + # We always permit partitioned popins to be loaded for testing. + # See https://explainers-by-googlers.github.io/partitioned-popins/ + if request.headers.get(b"Sec-Popin-Context") == b"partitioned": + headers.append((b'Popin-Policy', b"partitioned=*")) + # This sets a base href so that even if this content e.g. data or blob URLs # document, relative URLs will resolve. - return (status, [("Content-Type", "text/html")], f""" + return (status, headers, f""" diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.close.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.close.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.close.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.cookies-popin.py b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.cookies-popin.py index f5d94c3c5f1bf..74024dd2f002b 100644 --- a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.cookies-popin.py +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.cookies-popin.py @@ -3,6 +3,7 @@ def main(request, response): id = request.GET[b'id'] headers = setNoCacheAndCORSHeaders(request, response) headers[0] = (b"Content-Type", b"text/html") + headers.append((b'Popin-Policy', b"partitioned=*")) cookies = readCookies(request) message = b"ReadOnLoad:" if cookies.get(b"first-party-strict") == id: diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.localStorage-popin.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.localStorage-popin.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.localStorage-popin.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.permissions-popin.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.permissions-popin.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.permissions-popin.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.proxy-popin.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.proxy-popin.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.proxy-popin.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.recursive.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.recursive.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.recursive.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.http.py b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.http.py index 440d9da94dde9..60a0fc2a28a43 100644 --- a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.http.py +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.http.py @@ -3,6 +3,7 @@ def main(request, response): # Step 4 (partitioned-popins/partitioned-popins.request-header.tentative.https.window.js) headers = setNoCacheAndCORSHeaders(request, response) headers[0] = (b"Content-Type", b"text/html") + headers.append((b'Popin-Policy', b"partitioned=*")) message = request.GET[b'message'] message += b"HTTP(" message += request.headers.get(b"Sec-Popin-Context", b"missing") diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.initial.py b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.initial.py index 59e7e947876c8..f182ae3dee18a 100644 --- a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.initial.py +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.initial.py @@ -6,4 +6,5 @@ def main(request, response): message += b")-" headers = setNoCacheAndCORSHeaders(request, response) headers.append((b'Location', b"/partitioned-popins/resources/partitioned-popins.request-header.http.py?message=" + message)) + headers.append((b'Popin-Policy', b"partitioned=*")) return 302, headers, b'{"redirect": true}' \ No newline at end of file diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.js.py b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.js.py index 603891733fde7..7878693b220af 100644 --- a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.js.py +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.request-header.js.py @@ -3,6 +3,7 @@ def main(request, response): # Step 5 (partitioned-popins/partitioned-popins.request-header.tentative.https.window.js) headers = setNoCacheAndCORSHeaders(request, response) headers[0] = (b"Content-Type", b"text/html") + headers.append((b'Popin-Policy', b"partitioned=*")) message = request.GET[b'message'] message += b"JS(" message += request.headers.get(b"Sec-Popin-Context", b"missing") diff --git a/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.wait.html.headers b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.wait.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/partitioned-popins.wait.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/popinContextType.html.headers b/testing/web-platform/tests/partitioned-popins/resources/popinContextType.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/popinContextType.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=* diff --git a/testing/web-platform/tests/partitioned-popins/resources/popinContextTypesSupported.html.headers b/testing/web-platform/tests/partitioned-popins/resources/popinContextTypesSupported.html.headers new file mode 100644 index 0000000000000..783b6856418d2 --- /dev/null +++ b/testing/web-platform/tests/partitioned-popins/resources/popinContextTypesSupported.html.headers @@ -0,0 +1 @@ +Popin-Policy: partitioned=*