Index: LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5405562dd3436777bb1ddd96a84f2ad412bcd476 |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js |
@@ -0,0 +1,26 @@ |
+importScripts('test-helpers.js'); |
+ |
+var port = undefined; |
+ |
+self.onmessage = function(e) { |
+ var message = e.data; |
+ if ('port' in message) { |
+ port = message.port; |
+ port.postMessage({ready: true}); |
+ } |
+}; |
+ |
+self.addEventListener('fetch', function(event) { |
+ var url = event.request.url; |
+ if (url.indexOf('fetch-request-css-base-url-style.css') != -1) { |
+ event.respondWith(fetch( |
+ get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() + |
+ 'fetch-request-css-base-url-style.css', |
+ {mode: 'no-cors'})); |
+ } else if (url.indexOf('dummy.png') != -1) { |
+ port.postMessage({ |
+ url: event.request.url, |
+ referrer: event.request.referrer |
+ }); |
+ } |
+ }); |