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

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

Issue 1867293004: Set service worker response info data for foreign fetch intercepted fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ff-check-origin
Patch Set: address comment Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js
index 765972c71856bafce9298feab5441fe47e62f5af..0ea6e4adc3f96c70399da24e12f1834f8a5aa6b2 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/foreign-fetch-worker.js
@@ -13,21 +13,24 @@ self.addEventListener('install', function(event) {
});
function handle_basic(event) {
- event.respondWith({response:
- new Response('Foreign Fetch',
- {headers: {'Access-Control-Allow-Origin': '*'}})});
+ event.respondWith({response: new Response('Foreign Fetch')});
}
function handle_onmessage(event) {
event.respondWith({response:
new Response('<script>window.onmessage = e => e.ports[0].postMessage("failed");</script>',
- {headers: {'Content-Type': 'text/html', 'Access-Control-Allow-Origin': '*'}})});
+ {headers: {'Content-Type': 'text/html'}})});
+}
+
+function handle_fallback(event) {
+ // Do nothing.
}
self.addEventListener('foreignfetch', function(event) {
var url = event.request.url;
var handlers = [
{ pattern: '?basic', fn: handle_basic },
+ { pattern: '?fallback', fn: handle_fallback },
{ pattern: '?onmessage', fn: handle_onmessage }
];
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698