Index: LayoutTests/http/tests/serviceworker/resources/fetch-request-image-worker.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-request-image-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-request-image-worker.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3bb208ca29db67590733672eff5eb9c1726ed09c |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-request-image-worker.js |
@@ -0,0 +1,20 @@ |
+var requests = []; |
+ |
+self.onmessage = function(e) { |
+ var message = e.data; |
+ if ('port' in message) { |
+ var port = message.port; |
+ port.postMessage(requests); |
+ } |
+}; |
+ |
+self.addEventListener('fetch', function(event) { |
+ var url = event.request.url; |
+ if (url.indexOf('dummy?test') == -1) { |
+ return; |
+ } |
+ requests[url] = { |
+ mode: event.request.mode, |
yhirano
2014/10/08 09:31:39
Maybe this will be used for the request mode trans
horo
2014/10/08 10:02:47
This file is used from fetch-request-image.html.
T
|
+ }; |
+ event.respondWith(Promise.reject()); |
+ }); |