| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- This is in chromium/ because it relies on the internals API to terminate a |
| 3 service worker. --> |
| 4 <title>Service Worker: Stopping the worker during responding to a fetch</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/test-helpers.js"></script> |
| 8 <script> |
| 9 |
| 10 promise_test(t => { |
| 11 var SCOPE = 'resources/slow-fetch-and-stop-worker-iframe.html'; |
| 12 var SCRIPT = 'resources/respondwith-fetch-worker.js'; |
| 13 return service_worker_unregister_and_register(t, SCRIPT, SCOPE) |
| 14 .then(r => { |
| 15 add_completion_callback(() => r.unregister()); |
| 16 return wait_for_state(t, r.installing, 'activated'); |
| 17 }) |
| 18 .then(() => { return with_iframe(SCOPE, {auto_remove: true}); }) |
| 19 .then(f => { |
| 20 return new Promise(resolve => { |
| 21 addEventListener('message', resolve); |
| 22 f.contentWindow.postMessage('run', '*'); |
| 23 }) |
| 24 }) |
| 25 .then(e => { |
| 26 assert_equals(e.data, 'Rejected successfully'); |
| 27 }); |
| 28 }, 'Stopping the worker during responding fetch event cancels the request.'); |
| 29 |
| 30 </script> |
| OLD | NEW |