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/content-dpr/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/content-dpr/resources')
-rw-r--r-- | testing/web-platform/tests/content-dpr/resources/background.png | bin | 0 -> 86 bytes | |||
-rw-r--r-- | testing/web-platform/tests/content-dpr/resources/background.svg | 8 | ||||
-rw-r--r-- | testing/web-platform/tests/content-dpr/resources/dpr.py | 26 | ||||
-rw-r--r-- | testing/web-platform/tests/content-dpr/resources/square.png | bin | 0 -> 18299 bytes |
4 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-dpr/resources/background.png b/testing/web-platform/tests/content-dpr/resources/background.png Binary files differnew file mode 100644 index 0000000000..6db6c6b1b9 --- /dev/null +++ b/testing/web-platform/tests/content-dpr/resources/background.png diff --git a/testing/web-platform/tests/content-dpr/resources/background.svg b/testing/web-platform/tests/content-dpr/resources/background.svg new file mode 100644 index 0000000000..b2c544ed2d --- /dev/null +++ b/testing/web-platform/tests/content-dpr/resources/background.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" standalone="yes"?> + +<svg version="1.1" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<rect x="0" y="0" width="16" height="16" fill="#c0c0c0" /> +<rect x="16" y="0" width="16" height="16" fill="#ffffff" /> +<rect x="0" y="16" width="16" height="16" fill="#ffffff" /> +<rect x="16" y="16" width="16" height="16" fill="#c0c0c0" /> +</svg> diff --git a/testing/web-platform/tests/content-dpr/resources/dpr.py b/testing/web-platform/tests/content-dpr/resources/dpr.py new file mode 100644 index 0000000000..969ac2458d --- /dev/null +++ b/testing/web-platform/tests/content-dpr/resources/dpr.py @@ -0,0 +1,26 @@ +from wptserve.utils import isomorphic_decode + +def main(request, response): + """ + Simple handler that sets a response header based on which client hint + request headers were received. + """ + + response.headers.append(b"Access-Control-Allow-Origin", b"*") + values = request.GET + name = values.first(b'name') + type = values.first(b'mimeType') + dpr = values.first(b'dpr') + double = None + if b'double' in values: + double = values.first(b'double') + image_path = request.doc_root + u"/".join(request.url_parts[2].split(u"/")[:-1]) + u"/" + isomorphic_decode(name) + f = open(image_path, "rb") + buff = f.read() + f.close() + response.headers.set(b"Content-Type", type) + response.headers.set(b"Content-DPR", dpr) + if double: + response.headers.append(b"Content-DPR", double) + response.headers.set(b"Content-Length", len(buff)) + response.content = buff diff --git a/testing/web-platform/tests/content-dpr/resources/square.png b/testing/web-platform/tests/content-dpr/resources/square.png Binary files differnew file mode 100644 index 0000000000..01c9666a8d --- /dev/null +++ b/testing/web-platform/tests/content-dpr/resources/square.png |