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

Side by Side Diff: chrome/test/data/push_messaging/service_worker.js

Issue 1051253003: The Push Messaging browser tests should use matchAll() rather than getAll() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The "onpush" event currently understands two values as message payload 5 // The "onpush" event currently understands two values as message payload
6 // data coming from the test. Any other input is passed through to the 6 // data coming from the test. Any other input is passed through to the
7 // document unchanged. 7 // document unchanged.
8 // 8 //
9 // "shownotification" - Display a Web Notification with event.waitUntil(). 9 // "shownotification" - Display a Web Notification with event.waitUntil().
10 // "shownotification-without-waituntil" 10 // "shownotification-without-waituntil"
(...skipping 20 matching lines...) Expand all
31 }, function(ex) { 31 }, function(ex) {
32 sendMessageToClients('push', String(ex)); 32 sendMessageToClients('push', String(ex));
33 })); 33 }));
34 }; 34 };
35 35
36 function sendMessageToClients(type, data) { 36 function sendMessageToClients(type, data) {
37 var message = JSON.stringify({ 37 var message = JSON.stringify({
38 'type': type, 38 'type': type,
39 'data': data 39 'data': data
40 }); 40 });
41 clients.getAll().then(function(clients) { 41 clients.matchAll().then(function(clients) {
42 clients.forEach(function(client) { 42 clients.forEach(function(client) {
43 client.postMessage(message); 43 client.postMessage(message);
44 }); 44 });
45 }, function(error) { 45 }, function(error) {
46 console.log(error); 46 console.log(error);
47 }); 47 });
48 } 48 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698