| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- This is in chromium/ because it tests we don't crash when a |
| 3 request body blob is constructed asyncronously. --> |
| 4 <meta charset="utf-8"> |
| 5 <title>request body</title> |
| 6 <script src="../../resources/testharness.js"></script> |
| 7 <script src="../../resources/testharnessreport.js"></script> |
| 8 <script src="../resources/test-helpers.js"></script> |
| 9 <script> |
| 10 var resolve_done; |
| 11 var done_was_called = new Promise(resolve => resolve_done = resolve); |
| 12 // Called by the iframe when done. |
| 13 function done(result) { resolve_done(result); } |
| 14 |
| 15 // This test creates an controlled iframe that does a request with a request |
| 16 // body blob. The service worker confirms it can read the blob and responds |
| 17 // with 'Pass'. |
| 18 promise_test(t => { |
| 19 var worker = 'resources/request-body-blob-crash-worker.js'; |
| 20 var scope = 'resources/request-body-blob-crash-iframe.html'; |
| 21 var registration; |
| 22 return service_worker_unregister_and_register(t, worker, scope) |
| 23 .then(reg => { |
| 24 registration = reg; |
| 25 wait_for_state(t, reg.installing, 'activated'); |
| 26 }) |
| 27 .then(() => with_iframe(scope)) |
| 28 .then(() => done_was_called) |
| 29 .then(result => { |
| 30 assert_equals(result, 'Pass'); |
| 31 registration.unregister(); |
| 32 }); |
| 33 }, 'Service worker can read the request body blob and we dont crash'); |
| 34 </script> |
| OLD | NEW |