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