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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/mint-new-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 unified diff | Download patch
OLDNEW
(Empty)
1 import time
2
3 body = '''
4 onactivate = (e) => e.waitUntil(clients.claim());
5 var resolve_wait_until;
6 var wait_until = new Promise(resolve => {
7 resolve_wait_until = resolve;
8 });
9 onmessage = (e) => {
10 if (e.data == 'wait')
11 e.waitUntil(wait_until);
12 if (e.data == 'go')
13 resolve_wait_until();
14 };'''
15
16 def main(request, response):
17 headers = [('Cache-Control', 'no-cache, must-revalidate'),
18 ('Pragma', 'no-cache'),
19 ('Content-Type', 'application/javascript')]
20
21 skipWaiting = ''
22 if 'skip-waiting' in request.GET:
23 skipWaiting = 'skipWaiting();'
24
25 return headers, '/* %s %s */ %s %s' % (time.time(), time.clock(), skipWaitin g, body)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698