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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js

Issue 732003002: Use the request URL as the URL of the resources which are fetched ServiceWorker [3/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add comment Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 importScripts('test-helpers.js');
2
3 var port = undefined;
4
5 self.onmessage = function(e) {
6 var message = e.data;
7 if ('port' in message) {
8 port = message.port;
9 port.postMessage({ready: true});
10 }
11 };
12
13 self.addEventListener('fetch', function(event) {
14 var url = event.request.url;
15 if (url.indexOf('fetch-request-css-base-url-style.css') != -1) {
16 event.respondWith(fetch(
17 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() +
18 'fetch-request-css-base-url-style.css',
19 {mode: 'no-cors'}));
20 } else if (url.indexOf('dummy.png') != -1) {
21 port.postMessage({
22 url: event.request.url,
23 referrer: event.request.referrer
24 });
25 }
26 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698