Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..258f6e0cb10ce1fc7a56ca70f030a32d2c6d2e57 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/resources/sw-reject-all-with-error.js |
@@ -0,0 +1,8 @@ |
+// This service worker, once installed, will reject all resource requests, |
+// unless the resource has 'bypass' in the URL. For those URLs, it simply |
+// passes through the request. |
+self.addEventListener('fetch', function(event) { |
+ if (event.request.url.indexOf('bypass') != -1) |
+ event.respondWith(fetch.event.request); |
falken
2016/09/20 03:48:57
BTW event.respondWith(request) and not calling res
jww
2016/09/20 04:27:47
Acknowledged.
|
+ event.respondWith(Promise.reject(Error("Rejecting all requests"))); |
falken
2016/09/20 03:48:57
I must be missing something but why are these reje
jww
2016/09/20 04:27:47
It's a little tricky with what's going on here, bu
|
+}); |