Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-request-with-gc.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-request-with-gc.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-request-with-gc.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1a4bb83397d0d15e1155a5cf04960bb5e703fd97 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-request-with-gc.js |
| @@ -0,0 +1,13 @@ |
| +function wait(delay) { |
| + return new Promise(res => { |
| + setTimeout(res, delay); |
| + }); |
|
falken
2016/06/02 08:36:32
indent an additional two
(or make the whole thing
yhirano
2016/06/02 10:10:11
Done.
|
| +} |
| + |
| +self.addEventListener('fetch', e => { |
| + self.gc(); |
| + e.respondWith(wait(10).then(() => { |
| + self.gc(); |
| + return fetch(e.request); |
| + })); |
| + }); |