summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py')
-rw-r--r--testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py b/testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py
new file mode 100644
index 0000000000..3e15926185
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/update-during-installation-worker.py
@@ -0,0 +1,11 @@
+import random
+
+def main(request, response):
+ headers = [(b'Content-Type', b'application/javascript'),
+ (b'Cache-Control', b'max-age=0')]
+ # Plug in random.random() to the worker so update() finds a new worker every time.
+ body = u'''
+// %s
+importScripts('update-during-installation-worker.js');
+ '''.strip() % (random.random())
+ return headers, body