Title: [97542] trunk/LayoutTests
- Revision
- 97542
- Author
- [email protected]
- Date
- 2011-10-14 23:52:49 -0700 (Fri, 14 Oct 2011)
Log Message
[FileSystem API] readonly attributes test
https://bugs.webkit.org/show_bug.cgi?id=69655
Patch by Mark Pilgrim <[email protected]> on 2011-10-14
Reviewed by Adam Barth.
* fast/filesystem/resources/simple-readonly.js: Added.
(setReadonlyProperty):
(errorCallback):
(getFileCallback):
(successCallback):
* fast/filesystem/simple-readonly-expected.txt: Added.
* fast/filesystem/simple-readonly.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (97541 => 97542)
--- trunk/LayoutTests/ChangeLog 2011-10-15 06:51:25 UTC (rev 97541)
+++ trunk/LayoutTests/ChangeLog 2011-10-15 06:52:49 UTC (rev 97542)
@@ -1,5 +1,20 @@
2011-10-14 Mark Pilgrim <[email protected]>
+ [FileSystem API] readonly attributes test
+ https://bugs.webkit.org/show_bug.cgi?id=69655
+
+ Reviewed by Adam Barth.
+
+ * fast/filesystem/resources/simple-readonly.js: Added.
+ (setReadonlyProperty):
+ (errorCallback):
+ (getFileCallback):
+ (successCallback):
+ * fast/filesystem/simple-readonly-expected.txt: Added.
+ * fast/filesystem/simple-readonly.html: Added.
+
+2011-10-14 Mark Pilgrim <[email protected]>
+
[FileSystem API] restricted Unicode characters in names
https://bugs.webkit.org/show_bug.cgi?id=69657
Added: trunk/LayoutTests/fast/filesystem/resources/simple-readonly.js (0 => 97542)
--- trunk/LayoutTests/fast/filesystem/resources/simple-readonly.js (rev 0)
+++ trunk/LayoutTests/fast/filesystem/resources/simple-readonly.js 2011-10-15 06:52:49 UTC (rev 97542)
@@ -0,0 +1,49 @@
+if (this.importScripts) {
+ importScripts('../resources/fs-worker-common.js');
+ importScripts('../resources/fs-test-util.js');
+}
+
+description("FileSystem API readonly attributes test.");
+
+var fileSystem;
+var fileEntry;
+var fileMetadata;
+
+function setReadonlyProperty(property, value)
+{
+ oldValue = eval(property);
+ debug("trying to set readonly property " + property);
+ evalAndLog(property + " = " + value);
+ newValue = eval(property);
+ if (oldValue == newValue) {
+ testPassed(property + " is still " + oldValue);
+ } else {
+ testFailed(property + " value was changed");
+ }
+}
+
+function errorCallback(err) {
+ testFailed(err);
+ finishJSTest();
+}
+
+function getFileCallback(entry) {
+ fileEntry = entry;
+ setReadonlyProperty("fileEntry.isFile", "false");
+ setReadonlyProperty("fileEntry.isDirectory", "true");
+ setReadonlyProperty("fileEntry.name", "'bar'");
+ setReadonlyProperty("fileEntry.fullPath", "'bar'");
+ setReadonlyProperty("fileEntry.filesystem", "null");
+ finishJSTest();
+}
+
+function successCallback(fs) {
+ fileSystem = fs;
+ setReadonlyProperty("fileSystem.name", "'bar'");
+ root = evalAndLog("root = fileSystem.root");
+ evalAndLog("root.getFile('foo', {create:true}, getFileCallback, errorCallback)");
+}
+
+var jsTestIsAsync = true;
+evalAndLog("webkitRequestFileSystem(TEMPORARY, 100, successCallback, errorCallback)");
+var successfullyParsed = true;
Added: trunk/LayoutTests/fast/filesystem/simple-readonly-expected.txt (0 => 97542)
--- trunk/LayoutTests/fast/filesystem/simple-readonly-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/filesystem/simple-readonly-expected.txt 2011-10-15 06:52:49 UTC (rev 97542)
@@ -0,0 +1,30 @@
+FileSystem API readonly attributes test.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitRequestFileSystem(TEMPORARY, 100, successCallback, errorCallback)
+trying to set readonly property fileSystem.name
+fileSystem.name = 'bar'
+PASS fileSystem.name is still file__0:Temporary
+root = fileSystem.root
+root.getFile('foo', {create:true}, getFileCallback, errorCallback)
+trying to set readonly property fileEntry.isFile
+fileEntry.isFile = false
+PASS fileEntry.isFile is still true
+trying to set readonly property fileEntry.isDirectory
+fileEntry.isDirectory = true
+PASS fileEntry.isDirectory is still false
+trying to set readonly property fileEntry.name
+fileEntry.name = 'bar'
+PASS fileEntry.name is still foo
+trying to set readonly property fileEntry.fullPath
+fileEntry.fullPath = 'bar'
+PASS fileEntry.fullPath is still /foo
+trying to set readonly property fileEntry.filesystem
+fileEntry.filesystem = null
+PASS fileEntry.filesystem is still [object DOMFileSystem]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/filesystem/simple-readonly.html (0 => 97542)
--- trunk/LayoutTests/fast/filesystem/simple-readonly.html (rev 0)
+++ trunk/LayoutTests/fast/filesystem/simple-readonly.html 2011-10-15 06:52:49 UTC (rev 97542)
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes