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.seek to write overlapping existing data i
n a file."); | 8 description("Test using FileWriterSync.seek to write overlapping existing data i
n 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Verify the contents. | 82 // Verify the contents. |
83 contents = reader.readAsBinaryString(file); | 83 contents = reader.readAsBinaryString(file); |
84 for (i = 0; i < extensionOffset; ++i) | 84 for (i = 0; i < extensionOffset; ++i) |
85 assert(contents.charCodeAt(i) == testData.charCodeAt(i)); | 85 assert(contents.charCodeAt(i) == testData.charCodeAt(i)); |
86 for (j = 0; i < testData.length + extensionOffset; ++i, ++j) | 86 for (j = 0; i < testData.length + extensionOffset; ++i, ++j) |
87 assert(contents.charCodeAt(i) == testData.charCodeAt(j)); | 87 assert(contents.charCodeAt(i) == testData.charCodeAt(j)); |
88 for (j = extensionOffset; i < writer.length; ++i, ++j) | 88 for (j = extensionOffset; i < writer.length; ++i, ++j) |
89 assert(contents.charCodeAt(i) == testData.charCodeAt(j)); | 89 assert(contents.charCodeAt(i) == testData.charCodeAt(j)); |
90 testPassed("Overlapped write 3 verified."); | 90 testPassed("Overlapped write 3 verified."); |
91 finishJSTest(); | 91 finishJSTest(); |
OLD | NEW |