OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>FileAPI Test: filereader_readAsArrayBuffer</title> |
| 6 <link rel="author" title="Intel" href="http://www.intel.com"> |
| 7 <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBuf
fer"> |
| 8 <script src="../../../../resources/testharness.js"></script> |
| 9 <script src="../../../../resources/testharnessreport.js"></script> |
| 10 </head> |
| 11 <body> |
| 12 <div id="log"></div> |
| 13 |
| 14 <script> |
| 15 async_test(function() { |
| 16 var blob = new Blob(["TEST"]); |
| 17 var reader = new FileReader(); |
| 18 |
| 19 reader.onload = this.step_func(function(evt) { |
| 20 assert_equals(reader.result.byteLength, 4, "The byteLength is 4"); |
| 21 assert_true(reader.result instanceof ArrayBuffer, "The result is instanc
eof ArrayBuffer"); |
| 22 assert_equals(reader.readyState, reader.DONE); |
| 23 this.done(); |
| 24 }); |
| 25 |
| 26 reader.onloadstart = this.step_func(function(evt) { |
| 27 assert_equals(reader.readyState, reader.LOADING); |
| 28 }); |
| 29 |
| 30 reader.onprogress = this.step_func(function(evt) { |
| 31 assert_equals(reader.readyState, reader.LOADING); |
| 32 }); |
| 33 |
| 34 reader.readAsArrayBuffer(blob); |
| 35 }); |
| 36 </script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |