diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/client-hints/clear-site-data/resources | |
parent | Initial commit. (diff) | |
download | firefox-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/client-hints/clear-site-data/resources')
-rw-r--r-- | testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py | 15 | ||||
-rw-r--r-- | testing/web-platform/tests/client-hints/clear-site-data/resources/clear-site-data.py | 12 |
2 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py b/testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py new file mode 100644 index 0000000000..4fc4c331f2 --- /dev/null +++ b/testing/web-platform/tests/client-hints/clear-site-data/resources/check-client-hints.py @@ -0,0 +1,15 @@ +""" +Step 2/6 (/client-hints/clear-site-data/clear-site-data-{}.https.html) +Step 3/4 (/client-hints/clear-site-data/set-client-hints-{}-clear-{}.https.html) +""" +def main(request, response): + if b"sec-ch-device-memory" in request.headers: + result = u"HadDeviceMemory" + else: + result = u"MissingDeviceMemory" + content = u''' + <script> + window.opener.postMessage("%s" , "*"); + </script>''' % (result) + headers = [(b"Content-Type", b"text/html")] + return 200, headers, content diff --git a/testing/web-platform/tests/client-hints/clear-site-data/resources/clear-site-data.py b/testing/web-platform/tests/client-hints/clear-site-data/resources/clear-site-data.py new file mode 100644 index 0000000000..fd16be9fbc --- /dev/null +++ b/testing/web-platform/tests/client-hints/clear-site-data/resources/clear-site-data.py @@ -0,0 +1,12 @@ +""" +Step 5 (/client-hints/clear-site-data/clear-site-data-{}.https.html) +""" +def main(request, response): + content = u''' + <script> + window.onload = function() { + window.location.href = "/client-hints/clear-site-data/resources/check-client-hints.py"; + }; + </script>''' + headers = [(b"Content-Type", b"text/html"), (b"Clear-Site-Data", b'"%s"' % (request.GET.first(b"target", b"*")))] + return 200, headers, content |