| OLD | NEW |
| 1 // Helper routine. | 1 // Helper routine. |
| 2 function toString(obj) { | 2 function toString(obj) { |
| 3 if (obj == undefined) { | 3 if (obj == undefined) { |
| 4 return "undefined"; | 4 return "undefined"; |
| 5 } else if (typeof obj == 'object') { | 5 } else if (typeof obj == 'object') { |
| 6 if (obj.length != undefined) { | 6 if (obj.length != undefined) { |
| 7 var stringArray = []; | 7 var stringArray = []; |
| 8 for (var i = 0; i < obj.length; ++i) | 8 for (var i = 0; i < obj.length; ++i) |
| 9 stringArray.push(toString(obj[i])); | 9 stringArray.push(toString(obj[i])); |
| 10 stringArray.sort(); | 10 stringArray.sort(); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 this.runNextTest(); | 200 this.runNextTest(); |
| 201 } else | 201 } else |
| 202 testFailed('Unexpectedly succeeded while ' + this.stage); | 202 testFailed('Unexpectedly succeeded while ' + this.stage); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 this.testReadEntriesSuccessCallback = function(entries) | 205 this.testReadEntriesSuccessCallback = function(entries) |
| 206 { | 206 { |
| 207 if (this.expectedErrorCode) | 207 if (this.expectedErrorCode) |
| 208 testFailed('Unexpectedly succeeded while ' + this.stage); | 208 testFailed('Unexpectedly succeeded while ' + this.stage); |
| 209 | 209 |
| 210 for (var i = 0; i < entries.length; ++i) | 210 this.readEntries.push.apply(this.readEntries, entries); |
| 211 this.readEntries.push(entries[i]); | |
| 212 | 211 |
| 213 if (entries.length) { | 212 if (entries.length) { |
| 214 this.currentReader.readEntries(bindCallback(this, this.testReadE
ntriesSuccessCallback), bindCallback(this, this.testErrorCallback)); | 213 this.currentReader.readEntries(bindCallback(this, this.testReadE
ntriesSuccessCallback), bindCallback(this, this.testErrorCallback)); |
| 215 return; | 214 return; |
| 216 } | 215 } |
| 217 | 216 |
| 218 testPassed('Succeeded: ' + this.stage); | 217 testPassed('Succeeded: ' + this.stage); |
| 219 debug('Entries: ' + toString(this.readEntries)); | 218 debug('Entries: ' + toString(this.readEntries)); |
| 220 this.runNextTest(); | 219 this.runNextTest(); |
| 221 }; | 220 }; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 } | 403 } |
| 405 | 404 |
| 406 function fileSystemCallback(fs) | 405 function fileSystemCallback(fs) |
| 407 { | 406 { |
| 408 fileSystem = fs; | 407 fileSystem = fs; |
| 409 runNextTest(); | 408 runNextTest(); |
| 410 } | 409 } |
| 411 | 410 |
| 412 var jsTestIsAsync = true; | 411 var jsTestIsAsync = true; |
| 413 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); | 412 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); |
| OLD | NEW |