Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-argument-worker.js

Issue 1255933004: Service Worker: Correct Web IDL of FetchEvent.respondWith method. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename IDL argument and method params. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+ }
+ });

Powered by Google App Engine
This is Rietveld 408576698