Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-response-xhr-worker.js
blob465fbc91baa71669ca9c3f32117ee834de8294d0
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 = new Headers;
8         headers.append('foo', 'foo');
9         headers.append('foo', 'bar');
10         resolve(new Response('hello world', {'headers': headers}));
11       }));
12   });