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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js

Issue 778703004: Implement ServiceWorkerClient attributes [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@properties-step1
Patch Set: Protect by a runtime flag Created 6 years 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/clients-getall-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js b/LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..f3aeeb352529683fc9ec173951f1ee2c7f666b68
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js
@@ -0,0 +1,16 @@
+self.onmessage = function(e) {
+ var port = e.data.port;
+
+ self.clients.getAll().then(function(clients) {
+ var message = [];
+ clients.forEach(function(client) {
+ message.push([client.visibilityState,
+ client.focused,
+ client.url,
+ client.frameType]);
+ });
+ // Sort by url
+ message.sort(function(a, b) { return a[2] > b[2] ? 1 : -1; });
+ port.postMessage(message);
+ });
+};
« no previous file with comments | « LayoutTests/http/tests/serviceworker/clients-getall.html ('k') | Source/modules/serviceworkers/ServiceWorkerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698