OLD | NEW |
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../resources/fs-worker-common.js'); | 2 importScripts('../resources/fs-worker-common.js'); |
3 importScripts('../../js/resources/js-test-pre.js'); | 3 importScripts('../../js/resources/js-test-pre.js'); |
4 importScripts('../resources/fs-test-util.js'); | 4 importScripts('../resources/fs-test-util.js'); |
5 } | 5 } |
6 | 6 |
7 description("Test making multiple async FileSystem operations."); | 7 description("Test making multiple async FileSystem operations."); |
8 | 8 |
9 var fileSystem = null; | 9 var fileSystem = null; |
10 | 10 |
11 var a; | 11 var a; |
12 var b; | 12 var b; |
13 var c; | 13 var c; |
14 var d; | 14 var d; |
15 | 15 |
16 var paths = []; | 16 var paths = []; |
17 var dirsCount = 0; | 17 var dirsCount = 0; |
18 var reader = null; | 18 var reader = null; |
19 | 19 |
20 function errorCallback(error) { | 20 function errorCallback(error) { |
21 debug("Got error: " + error.code); | 21 debug("Got error: " + error.name); |
22 removeAllInDirectory(fileSystem.root); | 22 removeAllInDirectory(fileSystem.root); |
23 finishJSTest(); | 23 finishJSTest(); |
24 } | 24 } |
25 | 25 |
26 function entriesCallback(entries) { | 26 function entriesCallback(entries) { |
27 for (var i = 0; i < entries.length; ++i) { | 27 for (var i = 0; i < entries.length; ++i) { |
28 paths.push(entries[i].fullPath); | 28 paths.push(entries[i].fullPath); |
29 if (entries[i].isDirectory) | 29 if (entries[i].isDirectory) |
30 dirsCount++; | 30 dirsCount++; |
31 } | 31 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 helper.run(function() { | 97 helper.run(function() { |
98 webkitRequestFileSystem.apply(this, [this.TEMPORARY, 100, function(fs) { | 98 webkitRequestFileSystem.apply(this, [this.TEMPORARY, 100, function(fs) { |
99 debug("Got FileSystem:" + fs.name); | 99 debug("Got FileSystem:" + fs.name); |
100 fileSystem = fs; | 100 fileSystem = fs; |
101 removeAllInDirectory(fileSystem.root, function(){ helper.done(); }, erro
rCallback); | 101 removeAllInDirectory(fileSystem.root, function(){ helper.done(); }, erro
rCallback); |
102 }, errorCallback]); }); | 102 }, errorCallback]); }); |
103 debug("requested FileSystem."); | 103 debug("requested FileSystem."); |
104 helper.join(asyncTest1); | 104 helper.join(asyncTest1); |
105 } else | 105 } else |
106 debug("This test requires FileSystem API support."); | 106 debug("This test requires FileSystem API support."); |
OLD | NEW |