Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / fetch-event-respond-with-argument-worker.js
blob712c4b73c9bc6da7c828a4c194b09ad9018d47ae
1 self.addEventListener('fetch', function(event) {
2     var testcase = new URL(event.request.url).search;
3     switch (testcase) {
4     case '?response-object':
5       event.respondWith(new Response('body'));
6       break;
7     case '?response-promise-object':
8       event.respondWith(Promise.resolve(new Response('body')));
9       break;
10     case '?other-value':
11       event.respondWith(new Object());
12       break;
13     }
14   });