3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/fs-test-util.js"></script>
8 description('This test tries calling various filesystem functions with too few arguments.');
10 function errorCallback(error
)
12 debug("Error occured:" + error
.name
);
16 function successCallback(fs
)
19 debug("Successfully obtained Persistent FileSystem:" + fileSystem
.name
);
21 shouldThrow("fileSystem.root.removeRecursively()");
22 shouldThrow("fileSystem.root.moveTo()");
23 shouldThrow("fileSystem.root.copyTo()");
24 reader
= fileSystem
.root
.createReader();
25 shouldThrow("reader.readEntries()");
27 reader
.readEntries(function(entries
) {
28 window
.entries
= entries
;
30 fileSystem
.root
.getFile("/test", { create
: true }, function(entry
) {
32 shouldThrow("entry.createWriter()");
33 shouldThrow("entry.file()");
35 entry
.createWriter(function(writer
) {
36 window
.writer
= writer
;
38 shouldThrow("writer.write()");
39 shouldThrow("writer.seek()");
40 shouldThrow("writer.truncate()");
48 if (window
.webkitRequestFileSystem
) {
49 shouldThrow("webkitResolveLocalFileSystemURL()");
50 shouldThrow("webkitRequestFileSystem()");
51 shouldThrow("webkitRequestFileSystem(PERSISTENT)");
52 shouldThrow("webkitRequestFileSystem(PERSISTENT, 100)");
53 webkitRequestFileSystem(window
.TEMPORARY
, 100, successCallback
, errorCallback
);
54 window
.jsTestIsAsync
= true;
56 debug("This test requires FileSystem API support.");