Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/update-worker.py

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
+

Powered by Google App Engine
This is Rietveld 408576698