| OLD | NEW |
| 1 if (this.importScripts) { | 1 if (this.importScripts) { |
| 2 importScripts('fs-worker-common.js'); | 2 importScripts('fs-worker-common.js'); |
| 3 importScripts('../../js/resources/js-test-pre.js'); | 3 importScripts('../../../resources/js-test.js'); |
| 4 importScripts('file-writer-utils.js'); | 4 importScripts('file-writer-utils.js'); |
| 5 } | 5 } |
| 6 | 6 |
| 7 description("Test using FileWriter.seek to write overlapping existing data in a
file."); | 7 description("Test using FileWriter.seek to write overlapping existing data in a
file."); |
| 8 | 8 |
| 9 var fileEntry; | 9 var fileEntry; |
| 10 var fileWriter; | 10 var fileWriter; |
| 11 var testData = "Lorem ipsum"; | 11 var testData = "Lorem ipsum"; |
| 12 var seekBackwardOffset = -4; | 12 var seekBackwardOffset = -4; |
| 13 var seekForwardOffset = 4; | 13 var seekForwardOffset = 4; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // data for the test we want to run. In the execution phase, we do a seek and a
write, and the utility function that does those also validates that the data | 64 // data for the test we want to run. In the execution phase, we do a seek and a
write, and the utility function that does those also validates that the data |
| 65 // actually got written. So in the validation phase, we only have to check that
the rest of the file didn't get corrupted while we were writing our bit. | 65 // actually got written. So in the validation phase, we only have to check that
the rest of the file didn't get corrupted while we were writing our bit. |
| 66 function runTest(fileEntryIn, fileWriterIn) { | 66 function runTest(fileEntryIn, fileWriterIn) { |
| 67 fileEntry = fileEntryIn; | 67 fileEntry = fileEntryIn; |
| 68 fileWriter = fileWriterIn; | 68 fileWriter = fileWriterIn; |
| 69 setFileContents(fileEntry, fileWriter, testData, testSeekBackward); | 69 setFileContents(fileEntry, fileWriter, testData, testSeekBackward); |
| 70 } | 70 } |
| 71 | 71 |
| 72 var jsTestIsAsync = true; | 72 var jsTestIsAsync = true; |
| 73 setupAndRunTest(1024, 'file-writer-truncate-extend', runTest); | 73 setupAndRunTest(1024, 'file-writer-truncate-extend', runTest); |
| OLD | NEW |