OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <pre id='console'></pre> |
| 8 <script> |
| 9 description("Test FileReader methods and their argument type checking."); |
| 10 |
| 11 if (window.testRunner) |
| 12 testRunner.dumpAsText(); |
| 13 |
| 14 var blob = new Blob(["aa"]); |
| 15 var fileReader; |
| 16 var method; |
| 17 function testReadMethod(name) |
| 18 { |
| 19 fileReader = new FileReader(); |
| 20 shouldThrow("fileReader." + name + "();"); |
| 21 shouldThrow("fileReader." + name + "(2);"); |
| 22 shouldThrow("fileReader." + name + "(null)"); |
| 23 shouldThrow("fileReader." + name + "(fileReader)"); |
| 24 shouldThrow("fileReader." + name + "([])"); |
| 25 shouldNotThrow("fileReader." + name + "(blob, 'utf-8')"); |
| 26 shouldThrow("fileReader." + name + "(blob)"); |
| 27 } |
| 28 |
| 29 var methods = [ "readAsArrayBuffer", "readAsBinaryString", "readAsText", "readAs
DataURL" ]; |
| 30 |
| 31 methods.forEach(function (m) { testReadMethod(m); }); |
| 32 |
| 33 </script> |
| 34 </body> |
| 35 </html> |
OLD | NEW |