Title: [96956] trunk/LayoutTests
- Revision
- 96956
- Author
- [email protected]
- Date
- 2011-10-07 10:20:55 -0700 (Fri, 07 Oct 2011)
Log Message
Add missing tests for LegacyDefaultOptionalArguments/FileAPI IDL
https://bugs.webkit.org/show_bug.cgi?id=66236
Reviewed by Darin Adler.
These APIs are all very new and everyone who's using them should be
aware that they are vendor-prefixed and subject to adjustments as the
spec evolves. Recently, we changed these APIs to more carefully check
whether required parameters are actually present. This patch adds
tests to verify that we're doing the proper checks.
* fast/files/not-enough-arguments-expected.txt: Added.
* fast/files/not-enough-arguments.html: Added.
* fast/filesystem/not-enough-arguments-expected.txt: Added.
* fast/filesystem/not-enough-arguments.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (96955 => 96956)
--- trunk/LayoutTests/ChangeLog 2011-10-07 17:19:32 UTC (rev 96955)
+++ trunk/LayoutTests/ChangeLog 2011-10-07 17:20:55 UTC (rev 96956)
@@ -1,3 +1,21 @@
+2011-10-07 Adam Barth <[email protected]>
+
+ Add missing tests for LegacyDefaultOptionalArguments/FileAPI IDL
+ https://bugs.webkit.org/show_bug.cgi?id=66236
+
+ Reviewed by Darin Adler.
+
+ These APIs are all very new and everyone who's using them should be
+ aware that they are vendor-prefixed and subject to adjustments as the
+ spec evolves. Recently, we changed these APIs to more carefully check
+ whether required parameters are actually present. This patch adds
+ tests to verify that we're doing the proper checks.
+
+ * fast/files/not-enough-arguments-expected.txt: Added.
+ * fast/files/not-enough-arguments.html: Added.
+ * fast/filesystem/not-enough-arguments-expected.txt: Added.
+ * fast/filesystem/not-enough-arguments.html: Added.
+
2011-10-07 David Barr <[email protected]>
Implement currentColor support for box-shadow and text-shadow
Added: trunk/LayoutTests/fast/files/not-enough-arguments-expected.txt (0 => 96956)
--- trunk/LayoutTests/fast/files/not-enough-arguments-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/files/not-enough-arguments-expected.txt 2011-10-07 17:20:55 UTC (rev 96956)
@@ -0,0 +1,15 @@
+This test tries calling various FileAPI functions with too few arguments.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS reader.readAsArrayBuffer() threw exception TypeError: Not enough arguments.
+PASS reader.readAsBinaryString() threw exception TypeError: Not enough arguments.
+PASS reader.readAsText() threw exception TypeError: Not enough arguments.
+PASS reader.readAsDataURL() threw exception TypeError: Not enough arguments.
+PASS blobBuilder.append() threw exception TypeError: Type error.
+PASS fileInput.files.item() threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/files/not-enough-arguments.html (0 => 96956)
--- trunk/LayoutTests/fast/files/not-enough-arguments.html (rev 0)
+++ trunk/LayoutTests/fast/files/not-enough-arguments.html 2011-10-07 17:20:55 UTC (rev 96956)
@@ -0,0 +1,33 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<input type="file">
+<script>
+description('This test tries calling various FileAPI functions with too few arguments.');
+
+var reader = new FileReader();
+
+shouldThrow('reader.readAsArrayBuffer()');
+shouldThrow('reader.readAsBinaryString()');
+shouldThrow('reader.readAsText()');
+shouldThrow('reader.readAsDataURL()');
+
+var blobBuilder = new WebKitBlobBuilder();
+
+shouldThrow('blobBuilder.append()');
+
+var fileInput = document.getElementsByTagName('input')[0];
+
+shouldThrow('fileInput.files.item()');
+
+window.successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/filesystem/not-enough-arguments-expected.txt (0 => 96956)
--- trunk/LayoutTests/fast/filesystem/not-enough-arguments-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/filesystem/not-enough-arguments-expected.txt 2011-10-07 17:20:55 UTC (rev 96956)
@@ -0,0 +1,19 @@
+This test tries calling various filesystem functions with too few arguments.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Successfully obtained Persistent FileSystem:file__0:Temporary
+PASS fileSystem.root.moveTo() threw exception TypeError: Not enough arguments.
+PASS fileSystem.root.copyTo() threw exception TypeError: Not enough arguments.
+PASS reader.readEntries() threw exception TypeError: Not enough arguments.
+PASS entries.item() threw exception TypeError: Not enough arguments.
+PASS entry.createWriter() threw exception TypeError: Not enough arguments.
+PASS entry.file() threw exception TypeError: Not enough arguments.
+PASS writer.write() threw exception TypeError: Not enough arguments.
+PASS writer.seek() threw exception TypeError: Not enough arguments.
+PASS writer.truncate() threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/filesystem/not-enough-arguments.html (0 => 96956)
--- trunk/LayoutTests/fast/filesystem/not-enough-arguments.html (rev 0)
+++ trunk/LayoutTests/fast/filesystem/not-enough-arguments.html 2011-10-07 17:20:55 UTC (rev 96956)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description('This test tries calling various filesystem functions with too few arguments.');
+
+function errorCallback(error)
+{
+ debug("Error occured:" + error.code);
+ finishJSTest();
+}
+
+function successCallback(fs)
+{
+ fileSystem = fs;
+ debug("Successfully obtained Persistent FileSystem:" + fileSystem.name);
+
+ shouldThrow("fileSystem.root.moveTo()");
+ shouldThrow("fileSystem.root.copyTo()");
+ reader = fileSystem.root.createReader();
+ shouldThrow("reader.readEntries()");
+
+ reader.readEntries(function(entries) {
+ window.entries = entries;
+ shouldThrow("entries.item()");
+
+ fileSystem.root.getFile("/test", { create: true }, function(entry) {
+ window.entry = entry;
+ shouldThrow("entry.createWriter()");
+ shouldThrow("entry.file()");
+
+ entry.createWriter(function(writer) {
+ window.writer = writer;
+
+ shouldThrow("writer.write()");
+ shouldThrow("writer.seek()");
+ shouldThrow("writer.truncate()");
+
+ finishJSTest();
+ });
+ });
+ });
+}
+
+if (window.webkitRequestFileSystem) {
+ webkitRequestFileSystem(window.TEMPORARY, 100, successCallback, errorCallback);
+ window.jsTestIsAsync = true;
+} else
+ debug("This test requires FileSystem API support.");
+
+window.successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes