Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-request-css-base-url-worker.js
blob69269be325f423aa3940ea7ab8cc55556687d693
1 importScripts('../../resources/get-host-info.js');
2 importScripts('test-helpers.js');
4 var port = undefined;
6 self.onmessage = function(e) {
7   var message = e.data;
8   if ('port' in message) {
9     port = message.port;
10     port.postMessage({ready: true});
11   }
14 self.addEventListener('fetch', function(event) {
15     var url = event.request.url;
16     if (url.indexOf('fetch-request-css-base-url-style.css') != -1) {
17       event.respondWith(fetch(
18         get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() +
19         'fetch-request-css-base-url-style.css',
20         {mode: 'no-cors'}));
21     } else if (url.indexOf('dummy.png') != -1) {
22       port.postMessage({
23           url: event.request.url,
24           referrer: event.request.referrer
25         });
26     }
27   });