Chromium Code Reviews| 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); |
| + event.respondWith(Promise.reject(Error("Rejecting all requests"))); |
|
falken
2016/09/20 04:52:52
single quote JS
jww
2016/09/20 17:52:26
Done.
|
| +}); |