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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js

Issue 318393002: Initial implementation of ServiceWorkerGlobalScope.fetch() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incoroporated dominicc's comment Created 6 years, 6 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: LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js
index bd7db5ec53635d274f79faabed4d262659caf1e4..38ab23f90bccee4c3d8b97a725a3113d977dbbf4 100644
--- a/LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-event-test-worker.js
@@ -12,13 +12,18 @@ function handleReject(event) {
}));
}
+function handleFetch(event) {
+ event.respondWith(fetch('other.html'));
+}
+
self.addEventListener('fetch', function(event) {
var url = event.request.url;
var handlers = [
{ pattern: 'helloworld', fn: handleHelloWorld },
{ pattern: '?ignore', fn: function() {} },
{ pattern: '?null', fn: handleNullBody },
- { pattern: '?reject', fn: handleReject }
+ { pattern: '?reject', fn: handleReject },
+ { pattern: '?fetch', fn: handleFetch }
];
var handler = null;

Powered by Google App Engine
This is Rietveld 408576698