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

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

Issue 2881743002: [ServiceWorker] Revise wpt tests for Client.type (Closed)
Patch Set: Revise code comments Created 3 years, 7 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: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-get-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-get-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-get-worker.js
deleted file mode 100644
index 4705e358d889055014889e38db094dfce0277e8d..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-get-worker.js
+++ /dev/null
@@ -1,43 +0,0 @@
-self.onfetch = function(e) {
- if (e.request.url.indexOf('clients-get-frame.html') >= 0 ||
- e.request.url.indexOf('clients-get-client-types') >= 0) {
- // On navigation, the client id should be null.
- if (e.clientId === null) {
- e.respondWith(fetch(e.request));
- } else {
- e.respondWith(Response.error());
- }
- return;
- }
- e.respondWith(new Response(e.clientId));
-};
-
-self.onmessage = function(e) {
- var port = e.data.port;
- var client_ids = e.data.clientIds;
- var message = [];
-
- e.waitUntil(Promise.all(
- client_ids.map(function(client_id) {
- return self.clients.get(client_id);
- }))
- .then(function(clients) {
- // No matching client for a given id or a matched client is off-origin
- // from the service worker.
- if (clients.length == 1 && clients[0] == undefined) {
- port.postMessage(clients[0]);
- } else {
- clients.forEach(function(client) {
- if (client instanceof Client) {
- message.push([client.visibilityState,
- client.focused,
- client.url,
- client.frameType]);
- } else {
- message.push(client);
- }
- });
- port.postMessage(message);
- }
- }));
-};

Powered by Google App Engine
This is Rietveld 408576698