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..46849cb7b191db2d5baee37aa14649ada93221de |
--- /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); |
+ event.respondWith(Promise.reject(Error('Rejecting all requests'))); |
+}); |