Index: LayoutTests/fast/files/file-reader-methods-illegal-arguments.html |
diff --git a/LayoutTests/fast/files/file-reader-methods-illegal-arguments.html b/LayoutTests/fast/files/file-reader-methods-illegal-arguments.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0ab900b1dc007f2e926bb4b7cb4f1a3b95228cea |
--- /dev/null |
+++ b/LayoutTests/fast/files/file-reader-methods-illegal-arguments.html |
@@ -0,0 +1,35 @@ |
+<!doctype html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<pre id='console'></pre> |
+<script> |
+description("Test FileReader methods and their argument type checking."); |
+ |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+var blob = new Blob(["aa"]); |
+var fileReader; |
+var method; |
+function testReadMethod(name) |
+{ |
+ fileReader = new FileReader(); |
+ shouldThrow("fileReader." + name + "();"); |
+ shouldThrow("fileReader." + name + "(2);"); |
+ shouldThrow("fileReader." + name + "(null)"); |
+ shouldThrow("fileReader." + name + "(fileReader)"); |
+ shouldThrow("fileReader." + name + "([])"); |
+ shouldNotThrow("fileReader." + name + "(blob, 'utf-8')"); |
+ shouldThrow("fileReader." + name + "(blob)"); |
+} |
+ |
+var methods = [ "readAsArrayBuffer", "readAsBinaryString", "readAsText", "readAsDataURL" ]; |
+ |
+methods.forEach(function (m) { testReadMethod(m); }); |
+ |
+</script> |
+</body> |
+</html> |