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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/client-id-worker.js

Issue 1209493002: Service Worker: Surface Client.id attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update JS expression for truthiness. Created 5 years, 6 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 self.onmessage = function(e) {
2 var port = e.data.port;
3 var message = [];
4
5 Promise.resolve()
6 .then(function() {
7 // 1st matchAll()
8 return self.clients.matchAll().then(function(clients) {
9 clients.forEach(function(client) {
10 message.push(client.id);
11 });
12 });
13 })
14 .then(function() {
15 // 2nd matchAll()
16 return self.clients.matchAll().then(function(clients) {
17 clients.forEach(function(client) {
18 message.push(client.id);
19 });
20 });
21 })
22 .then(function() {
23 // Send an array containing ids of clients from 1st and 2nd matchAll()
24 port.postMessage(message);
25 });
26 };
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/clients-matchall.html ('k') | Source/modules/serviceworkers/Client.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698