| <html> |
| <head> |
| <script src="../js/resources/js-test-pre.js"></script> |
| <script src="resources/fs-test-util.js"></script> |
| </head> |
| <body> |
| <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.removeRecursively()"); |
| 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) { |
| shouldThrow("webkitResolveLocalFileSystemURL()"); |
| shouldThrow("webkitRequestFileSystem()"); |
| shouldThrow("webkitRequestFileSystem(PERSISTENT)"); |
| shouldThrow("webkitRequestFileSystem(PERSISTENT, 100)"); |
| webkitRequestFileSystem(window.TEMPORARY, 100, successCallback, errorCallback); |
| window.jsTestIsAsync = true; |
| } else |
| debug("This test requires FileSystem API support."); |
| </script> |
| <script src="../js/resources/js-test-post.js"></script> |
| </body> |
| </html> |