Index: LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-argument-worker.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-argument-worker.js b/LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-argument-worker.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..712c4b73c9bc6da7c828a4c194b09ad9018d47ae |
--- /dev/null |
+++ b/LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-argument-worker.js |
@@ -0,0 +1,14 @@ |
+self.addEventListener('fetch', function(event) { |
+ var testcase = new URL(event.request.url).search; |
+ switch (testcase) { |
+ case '?response-object': |
+ event.respondWith(new Response('body')); |
+ break; |
+ case '?response-promise-object': |
+ event.respondWith(Promise.resolve(new Response('body'))); |
+ break; |
+ case '?other-value': |
+ event.respondWith(new Object()); |
+ break; |
+ } |
+ }); |