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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js

Issue 2875383002: Upstream service worker `postMessage` tests to WPT (Closed)
Patch Set: Incorporate review feedback 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/resources/postmessage-msgport-to-client-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js
deleted file mode 100644
index 7af935f4f8fc01756980e46dcce5018ddc620e67..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-msgport-to-client-worker.js
+++ /dev/null
@@ -1,19 +0,0 @@
-self.onmessage = function(e) {
- e.waitUntil(self.clients.matchAll().then(function(clients) {
- clients.forEach(function(client) {
- var messageChannel = new MessageChannel();
- messageChannel.port1.onmessage =
- onMessageViaMessagePort.bind(null, messageChannel.port1);
- client.postMessage(undefined, [messageChannel.port2]);
- });
- }));
-};
-
-function onMessageViaMessagePort(port, e) {
- var message = e.data;
- if ('value' in message) {
- port.postMessage({ack: 'Acking value: ' + message.value});
- } else if ('done' in message) {
- port.postMessage({done: true});
- }
-}

Powered by Google App Engine
This is Rietveld 408576698