| 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('../../../resources/js-test.js'); |
| 4 importScripts('../resources/fs-test-util.js'); | 4 importScripts('../resources/fs-test-util.js'); |
| 5 importScripts('../resources/file-writer-utils.js'); | 5 importScripts('../resources/file-writer-utils.js'); |
| 6 } | 6 } |
| 7 | 7 |
| 8 description("Test using FileWriterSync.truncate to extend a file."); | 8 description("Test using FileWriterSync.truncate to extend a file."); |
| 9 | 9 |
| 10 // Start with an empty FileSystem. | 10 // Start with an empty FileSystem. |
| 11 var fileSystem = webkitRequestFileSystemSync(this.TEMPORARY, 100); | 11 var fileSystem = webkitRequestFileSystemSync(this.TEMPORARY, 100); |
| 12 removeAllInDirectorySync(fileSystem.root); | 12 removeAllInDirectorySync(fileSystem.root); |
| 13 | 13 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 31 var reader = new FileReaderSync(); | 31 var reader = new FileReaderSync(); |
| 32 var contents = reader.readAsBinaryString(file); | 32 var contents = reader.readAsBinaryString(file); |
| 33 var i; | 33 var i; |
| 34 for (i = 0; i < testData.length; ++i) | 34 for (i = 0; i < testData.length; ++i) |
| 35 assert(contents.charCodeAt(i) == testData.charCodeAt(i)); | 35 assert(contents.charCodeAt(i) == testData.charCodeAt(i)); |
| 36 for (; i < writer.length; ++i) | 36 for (; i < writer.length; ++i) |
| 37 assert(!contents.charCodeAt(i)); | 37 assert(!contents.charCodeAt(i)); |
| 38 | 38 |
| 39 testPassed("Truncate extension verified."); | 39 testPassed("Truncate extension verified."); |
| 40 finishJSTest(); | 40 finishJSTest(); |
| OLD | NEW |