OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 var fileSystem = null; |
| 3 |
| 4 function errorCallback(error) { |
| 5 chrome.test.fail("Got unexpected error: " + error.code); |
| 6 } |
| 7 |
| 8 function successCallback(entry) { |
| 9 chrome.test.succeed(); |
| 10 } |
| 11 |
| 12 function successEntryCallback(entry) { |
| 13 fileSystem.root.getDirectory('dir', {create:false}, |
| 14 function(directory) { |
| 15 // Do clean-up. (Assume the tab won't be reloaded in testing.) |
| 16 directory.removeRecursively(successCallback, errorCallback); |
| 17 }, errorCallback); |
| 18 } |
| 19 |
| 20 chrome.test.runTests([function tab() { |
| 21 console.log("Requesting a filesystem..."); |
| 22 requestFileSystem(window.TEMPORARY, 100, function(fs) { |
| 23 fileSystem = fs; |
| 24 // See if we get the same filesystem image. |
| 25 console.log("DONE requesting filesystem: " + fileSystem.name); |
| 26 fileSystem.root.getFile('dir/file', {create:false}, |
| 27 successEntryCallback, errorCallback); |
| 28 }, errorCallback); |
| 29 }]); |
| 30 </script> |
OLD | NEW |