Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/slow-fetch-and-stop-worker-iframe.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/slow-fetch-and-stop-worker-iframe.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/slow-fetch-and-stop-worker-iframe.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..04b211398a08075e77290d749ce8a450f5445fe2 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/slow-fetch-and-stop-worker-iframe.html |
| @@ -0,0 +1,18 @@ |
| +<!DOCTYPE html> |
| +<script> |
| +addEventListener('message', e => { |
| + fetch('./slow-response.php') |
| + .then(response => { |
| + internals.terminateServiceWorker(navigator.serviceWorker.controller); |
| + return response.text(); |
| + }) |
| + .then(() => { |
| + e.source.postMessage( |
| + 'Ugr.. Canceled respondWith resolves the promise somehow.', |
| + e.origin); |
|
falken
2017/04/18 05:05:34
I don't think you need the e.origin thing
shimazu
2017/04/19 05:49:46
IIUC, MessagePort.postMessage doesn't need the ori
|
| + }) |
| + .catch(() => { |
| + e.source.postMessage('Rejected successfully', e.origin); |
| + }); |
| + }); |
| +</script> |