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

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

Issue 1439333002: Service Worker: Add Clients.get(id) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add layout test Created 4 years, 11 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 var actual_client_id;
2
3 self.onfetch = function(e) {
4 // Get the subresource request from the second iframe.
5 if (e.request.url.indexOf('simple.txt') != -1) {
6 clients.matchAll().then(function(clients) {
7 clients.forEach(function(client) {
8 if (client.frameType == "nested" &&
9 client.url.indexOf('#2') != -1) {
10 actual_client_id = client.id;
11 }
12 });
13 });
14 }
15 };
16
17 self.onmessage = function(e) {
18 var port = e.data.port;
19
20 clients.get(actual_client_id).then(function(client) {
21 port.postMessage(client.url);
22 });
23 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698