summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py
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/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py
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/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py')
-rw-r--r--testing/web-platform/tests/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py b/testing/web-platform/tests/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py
new file mode 100644
index 0000000000..856f9dbc2a
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/navigation-preload/resources/resource-timing-scope.py
@@ -0,0 +1,19 @@
+import zlib
+
+def main(request, response):
+ type = request.GET.first(b"type")
+
+ if type == "normal":
+ content = b"This is Navigation Preload Resource Timing test."
+ output = zlib.compress(content, 9)
+ headers = [(b"Content-type", b"text/plain"),
+ (b"Content-Encoding", b"deflate"),
+ (b"X-Decoded-Body-Size", len(content)),
+ (b"X-Encoded-Body-Size", len(output)),
+ (b"Content-Length", len(output))]
+ return headers, output
+
+ if type == b"redirect":
+ response.status = 302
+ response.headers.append(b"Location", b"redirect-redirected.html")
+ return b""