diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/web-bundle/subresource-loading/resources | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/web-bundle/subresource-loading/resources')
3 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-bundle/subresource-loading/resources/check-cookie-and-return-bundle.py b/testing/web-platform/tests/web-bundle/subresource-loading/resources/check-cookie-and-return-bundle.py new file mode 100644 index 0000000000..0d4f14ecb7 --- /dev/null +++ b/testing/web-platform/tests/web-bundle/subresource-loading/resources/check-cookie-and-return-bundle.py @@ -0,0 +1,25 @@ +import os + + +def main(request, response): + origin = request.headers.get(b"origin") + + if origin is not None: + response.headers.set(b"Access-Control-Allow-Origin", origin) + response.headers.set(b"Access-Control-Allow-Methods", b"GET") + response.headers.set(b"Access-Control-Allow-Credentials", b"true") + + headers = [ + (b"Content-Type", b"application/webbundle"), + (b"X-Content-Type-Options", b"nosniff"), + ] + + cookie = request.cookies.first(b"milk", None) + if (cookie is not None) and cookie.value == b"1": + with open( + os.path.join(os.path.dirname(__file__), "../../resources/wbn/subresource.wbn"), + "rb", + ) as f: + return (200, headers, f.read()) + else: + return (400, [], "") diff --git a/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-controlled-iframe.html b/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-controlled-iframe.html new file mode 100644 index 0000000000..c8b7661f42 --- /dev/null +++ b/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-controlled-iframe.html @@ -0,0 +1 @@ +<body></body> diff --git a/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-for-request-monitor.js b/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-for-request-monitor.js new file mode 100644 index 0000000000..f67ac70686 --- /dev/null +++ b/testing/web-platform/tests/web-bundle/subresource-loading/resources/service-worker-for-request-monitor.js @@ -0,0 +1,12 @@ + +let request_urls = []; + +self.addEventListener('fetch', e => { + request_urls.push(e.request.url); + e.respondWith(fetch(e.request)); +}); + +self.addEventListener('message', e => { + e.source.postMessage(request_urls); + request_urls = []; +}); |