Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-request-xhr-worker.js
blob91b3abb14d9c675a0bd886344a26482f36bb5770
1 self.addEventListener('fetch', function(event) {
2     var url = event.request.url;
3     if (url.indexOf('dummy?test') == -1) {
4       return;
5     }
6     event.respondWith(new Promise(function(resolve) {
7         var headers = [];
8         for (var header of event.request.headers) {
9           headers.push(header);
10         }
11         event.request.text()
12           .then(function(result) {
13               resolve(new Response(JSON.stringify({
14                   method: event.request.method,
15                   mode: event.request.mode,
16                   credentials: event.request.credentials,
17                   headers: headers,
18                   body: result
19                 })));
20             });
21       }));
22   });