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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/forwarding-worker.js

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 4 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/forwarding-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/forwarding-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/forwarding-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..20e86ef0e99f96ad0c988c9945ca71ef5b839758
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/forwarding-worker.js
@@ -0,0 +1,15 @@
+let port;
+
+self.onmessage = event => {
+ const message = event.data;
+ if ('port' in message) {
+ port = message.port;
+ port.postMessage('READY');
+ }
+};
+
+self.addEventListener('fetch', event => {
+ port.postMessage('onfetch');
+
+ event.respondWith(fetch(event.request));
+});

Powered by Google App Engine
This is Rietveld 408576698