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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-blob-url.js

Issue 2695093003: Add LayoutTests to test Blob URL transfer to {Shared,Service}Workers (Closed)
Patch Set: . Created 3 years, 10 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-blob-url.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-blob-url.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-blob-url.js
new file mode 100644
index 0000000000000000000000000000000000000000..661c66dd3a7c3f1fb72bb10553c8f3e8f71d87e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-blob-url.js
@@ -0,0 +1,11 @@
+self.onmessage = e => {
+ if ('port' in e.data) {
+ let port = e.data.port;
+ port.onmessage = (e) => {
+ fetch(e.data)
+ .then(response => response.text())
+ .then(text => port.postMessage('Worker reply:' + text));
+ };
+ port.postMessage('Connected');
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698