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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-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-transferables-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-worker.js
deleted file mode 100644
index d35c1c952b880069eafe25aa971d8aa7c9293e05..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-worker.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var messageHandler = function(port, e) {
- var text_decoder = new TextDecoder;
- port.postMessage({
- content: text_decoder.decode(e.data),
- byteLength: e.data.byteLength
- });
-
- // Send back the array buffer via Client.postMessage.
- port.postMessage(e.data, [e.data.buffer]);
-
- port.postMessage({
- content: text_decoder.decode(e.data),
- byteLength: e.data.byteLength
- });
-};
-
-self.addEventListener('message', e => {
- if (e.ports[0]) {
- // Wait for messages sent via MessagePort.
- e.ports[0].onmessage = messageHandler.bind(null, e.ports[0]);
- return;
- }
- messageHandler(e.source, e);
- });

Powered by Google App Engine
This is Rietveld 408576698