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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-worker.js

Issue 1731823003: Service Worker: Add worker client test for Clients.get(id) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 10 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
1 self.onfetch = function(e) { 1 self.onfetch = function(e) {
2 if (e.request.url.indexOf('clients-get-frame.html') >= 0) { 2 if (e.request.url.indexOf('clients-get-frame.html') >= 0 ||
3 e.request.url.indexOf('clients-get-client-types') >= 0) {
3 // On navigation, the client id should be null. 4 // On navigation, the client id should be null.
4 if (e.clientId === null) { 5 if (e.clientId === null) {
5 e.respondWith(fetch(e.request)); 6 e.respondWith(fetch(e.request));
6 } else { 7 } else {
7 e.respondWith(Response.error()); 8 e.respondWith(Response.error());
8 } 9 }
9 return; 10 return;
10 } 11 }
11 e.respondWith(new Response(e.clientId)); 12 e.respondWith(new Response(e.clientId));
12 }; 13 };
(...skipping 20 matching lines...) Expand all
33 client.url, 34 client.url,
34 client.frameType]); 35 client.frameType]);
35 } else { 36 } else {
36 message.push(client); 37 message.push(client);
37 } 38 }
38 }); 39 });
39 port.postMessage(message); 40 port.postMessage(message);
40 } 41 }
41 })); 42 }));
42 }; 43 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-client-types-shared-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698