Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: LayoutTests/fast/files/file-reader-methods-illegal-arguments.html

Issue 114953006: Add missing FileReader argument typechecking. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/files/file-reader-methods-illegal-arguments-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/files/file-reader-methods-illegal-arguments-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698