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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/serviceworker/resources/client-id-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/client-id-worker.js b/LayoutTests/http/tests/serviceworker/resources/client-id-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..74bc3927ebe560eaa747341dc709ed58f404caef
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/resources/client-id-worker.js
@@ -0,0 +1,26 @@
+self.onmessage = function(e) {
+ var port = e.data.port;
+ var message = [];
+
+ Promise.resolve()
+ .then(function() {
+ // 1st matchAll()
+ return self.clients.matchAll().then(function(clients) {
+ clients.forEach(function(client) {
+ message.push(client.id);
+ });
+ });
+ })
+ .then(function() {
+ // 2nd matchAll()
+ return self.clients.matchAll().then(function(clients) {
+ clients.forEach(function(client) {
+ message.push(client.id);
+ });
+ });
+ })
+ .then(function() {
+ // Send an array containing ids of clients from 1st and 2nd matchAll()
+ port.postMessage(message);
+ });
+};
« 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