OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>Revoking blob URL used with XMLHttpRequest</title> |
| 3 <script src="../../../../resources/testharness.js"></script> |
| 4 <script src="../../../../resources/testharnessreport.js"></script> |
| 5 |
| 6 <script> |
| 7 async_test(function(t) { |
| 8 var blob = new Blob(["test"]); |
| 9 var url = URL.createObjectURL(blob); |
| 10 var xhr = new XMLHttpRequest(); |
| 11 xhr.open("GET", url); |
| 12 |
| 13 // Revoke the object URL. XHR should take a reference to the blob as soon a
s |
| 14 // it receives it in open(), so the request succeeds even though we revoke t
he |
| 15 // URL before calling send(). |
| 16 URL.revokeObjectURL(url); |
| 17 |
| 18 xhr.send(); |
| 19 |
| 20 xhr.onload = t.step_func(function() { |
| 21 assert_equals(xhr.response, "test"); |
| 22 t.done(); |
| 23 }) |
| 24 xhr.onerror = t.step_func(function() { |
| 25 assert_unreached("Got unexpected error event"); |
| 26 }) |
| 27 }); |
| 28 </script> |
OLD | NEW |