Index: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/update-worker.py |
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/update-worker.py b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/update-worker.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5158bf251701f0bbe3130bbfb941bf8749351df9 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/update-worker.py |
@@ -0,0 +1,14 @@ |
+import os |
+import time |
+ |
+def main(request, response): |
+ # update() does not bypass cache so set the max-age to 0 such that update() |
+ # can find a new version in the network. |
+ headers = [('Cache-Control', 'max-age: 0'), |
+ ('Content-Type', 'application/javascript')] |
+ with open(os.path.join(os.path.dirname(__file__), |
+ 'update-worker.js'), 'r') as file: |
+ script = file.read() |
+ # Return a different script for each access. |
+ return headers, '// %s\n%s' % (time.time(), script) |
+ |