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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 }), bindCallback(this, this.createErrorCallback)); | 45 }), bindCallback(this, this.createErrorCallback)); |
46 return; | 46 return; |
47 } | 47 } |
48 this.environment[entry.fullPath] = entry; | 48 this.environment[entry.fullPath] = entry; |
49 this.environment[entry.fullPath + '.size'] = 0; | 49 this.environment[entry.fullPath + '.size'] = 0; |
50 this.createNextEntry(); | 50 this.createNextEntry(); |
51 } | 51 } |
52 | 52 |
53 this.createErrorCallback = function(error, entry) | 53 this.createErrorCallback = function(error, entry) |
54 { | 54 { |
55 testFailed('Got unexpected error ' + error.code + ' while creating '
+ toString(entry)); | 55 testFailed('Got unexpected error ' + error.name + ' while creating '
+ toString(entry)); |
56 this.errorCallback(error); | 56 this.errorCallback(error); |
57 } | 57 } |
58 | 58 |
59 this.createNextEntry = function() | 59 this.createNextEntry = function() |
60 { | 60 { |
61 if (this.current >= this.entries.length) { | 61 if (this.current >= this.entries.length) { |
62 this.successCallback(this.environment); | 62 this.successCallback(this.environment); |
63 return; | 63 return; |
64 } | 64 } |
65 var entry = this.entries[this.current++]; | 65 var entry = this.entries[this.current++]; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 this.verifyNextEntry(); | 100 this.verifyNextEntry(); |
101 } | 101 } |
102 | 102 |
103 this.verifyErrorCallback = function(error, entry) | 103 this.verifyErrorCallback = function(error, entry) |
104 { | 104 { |
105 if (this.expectedNonexistent) { | 105 if (this.expectedNonexistent) { |
106 testPassed('Verified entry does NOT exist: ' + entry.fullPath); | 106 testPassed('Verified entry does NOT exist: ' + entry.fullPath); |
107 this.verifyNextEntry(); | 107 this.verifyNextEntry(); |
108 return; | 108 return; |
109 } | 109 } |
110 if (error == FileError.NOT_FOUND_ERR) | 110 if (error == 'NotFoundError') |
111 testFailed('Not found: ' + entry.fullPath); | 111 testFailed('Not found: ' + entry.fullPath); |
112 else | 112 else |
113 testFailed('Got unexpected error ' + error.code + ' for ' + entr
y.fullPath); | 113 testFailed('Got unexpected error ' + error.name + ' for ' + entr
y.fullPath); |
114 this.errorCallback(error); | 114 this.errorCallback(error); |
115 } | 115 } |
116 | 116 |
117 this.verifyNextEntry = function() | 117 this.verifyNextEntry = function() |
118 { | 118 { |
119 if (this.current >= this.entries.length) { | 119 if (this.current >= this.entries.length) { |
120 this.successCallback(); | 120 this.successCallback(); |
121 return; | 121 return; |
122 } | 122 } |
123 var entry = this.entries[this.current++]; | 123 var entry = this.entries[this.current++]; |
(...skipping 30 matching lines...) Expand all Loading... |
154 this.currentReader = null; | 154 this.currentReader = null; |
155 this.readEntries = []; | 155 this.readEntries = []; |
156 | 156 |
157 this.getSymbolString = function(symbol) | 157 this.getSymbolString = function(symbol) |
158 { | 158 { |
159 return 'this.environment["' + symbol + '"]'; | 159 return 'this.environment["' + symbol + '"]'; |
160 }; | 160 }; |
161 | 161 |
162 this.testSuccessCallback = function() | 162 this.testSuccessCallback = function() |
163 { | 163 { |
164 if (!this.expectedErrorCode) { | 164 if (!this.expectedError) { |
165 testPassed('Succeeded: ' + this.stage); | 165 testPassed('Succeeded: ' + this.stage); |
166 this.runNextTest(); | 166 this.runNextTest(); |
167 } else | 167 } else |
168 testFailed('Unexpectedly succeeded while ' + this.stage); | 168 testFailed('Unexpectedly succeeded while ' + this.stage); |
169 }; | 169 }; |
170 | 170 |
171 this.entry = null; | 171 this.entry = null; |
172 this.testGetSuccessCallback = function(entry) | 172 this.testGetSuccessCallback = function(entry) |
173 { | 173 { |
174 if (!this.expectedErrorCode) { | 174 if (!this.expectedError) { |
175 testPassed('Succeeded: ' + this.stage); | 175 testPassed('Succeeded: ' + this.stage); |
176 this.entry = entry; | 176 this.entry = entry; |
177 shouldBe.apply(this, ['this.environment[this.entry.fullPath].ful
lPath', '"' + entry.fullPath + '"']); | 177 shouldBe.apply(this, ['this.environment[this.entry.fullPath].ful
lPath', '"' + entry.fullPath + '"']); |
178 shouldBe.apply(this, ['this.environment[this.entry.fullPath].isF
ile + ""', '"' + entry.isFile + '"']); | 178 shouldBe.apply(this, ['this.environment[this.entry.fullPath].isF
ile + ""', '"' + entry.isFile + '"']); |
179 shouldBe.apply(this, ['this.environment[this.entry.fullPath].isD
irectory + ""', '"' + entry.isDirectory + '"']); | 179 shouldBe.apply(this, ['this.environment[this.entry.fullPath].isD
irectory + ""', '"' + entry.isDirectory + '"']); |
180 this.runNextTest(); | 180 this.runNextTest(); |
181 } else | 181 } else |
182 testFailed('Unexpectedly succeeded while ' + this.stage); | 182 testFailed('Unexpectedly succeeded while ' + this.stage); |
183 }; | 183 }; |
184 | 184 |
185 this.testCreateSuccessCallback = function(entry) | 185 this.testCreateSuccessCallback = function(entry) |
186 { | 186 { |
187 if (!this.expectedErrorCode) { | 187 if (!this.expectedError) { |
188 testPassed('Succeeded: ' + this.stage); | 188 testPassed('Succeeded: ' + this.stage); |
189 this.environment[entry.fullPath] = entry; | 189 this.environment[entry.fullPath] = entry; |
190 this.runNextTest(); | 190 this.runNextTest(); |
191 } else | 191 } else |
192 testFailed('Unexpectedly succeeded while ' + this.stage); | 192 testFailed('Unexpectedly succeeded while ' + this.stage); |
193 }; | 193 }; |
194 | 194 |
195 this.testGetParentSuccessCallback = function(entry) | 195 this.testGetParentSuccessCallback = function(entry) |
196 { | 196 { |
197 if (!this.expectedErrorCode) { | 197 if (!this.expectedError) { |
198 testPassed('Succeeded: ' + this.stage); | 198 testPassed('Succeeded: ' + this.stage); |
199 debug('Parent entry: ' + toString(entry)); | 199 debug('Parent entry: ' + toString(entry)); |
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.expectedError) |
208 testFailed('Unexpectedly succeeded while ' + this.stage); | 208 testFailed('Unexpectedly succeeded while ' + this.stage); |
209 | 209 |
210 this.readEntries.push.apply(this.readEntries, entries); | 210 this.readEntries.push.apply(this.readEntries, entries); |
211 | 211 |
212 if (entries.length) { | 212 if (entries.length) { |
213 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)); |
214 return; | 214 return; |
215 } | 215 } |
216 | 216 |
217 testPassed('Succeeded: ' + this.stage); | 217 testPassed('Succeeded: ' + this.stage); |
218 debug('Entries: ' + toString(this.readEntries)); | 218 debug('Entries: ' + toString(this.readEntries)); |
219 this.runNextTest(); | 219 this.runNextTest(); |
220 }; | 220 }; |
221 | 221 |
222 this.testMetadataSuccessCallback = function(metadata, entry) | 222 this.testMetadataSuccessCallback = function(metadata, entry) |
223 { | 223 { |
224 if (!this.expectedErrorCode) { | 224 if (!this.expectedError) { |
225 testPassed('Succeeded: ' + this.stage); | 225 testPassed('Succeeded: ' + this.stage); |
226 var symbol = entry + '.returned.modificationTime'; | 226 var symbol = entry + '.returned.modificationTime'; |
227 this.environment[symbol] = metadata.modificationTime; | 227 this.environment[symbol] = metadata.modificationTime; |
228 var entryMetadataString = this.getSymbolString(symbol); | 228 var entryMetadataString = this.getSymbolString(symbol); |
229 if (entry != '/') { | 229 if (entry != '/') { |
230 shouldBeGreaterThanOrEqual.apply(this, [entryMetadataString,
'this.roundedStartDate']); | 230 shouldBeGreaterThanOrEqual.apply(this, [entryMetadataString,
'this.roundedStartDate']); |
231 } | 231 } |
232 if (metadata.size) { | 232 if (metadata.size) { |
233 this.environment[entry + '.returned.size'] = metadata.size; | 233 this.environment[entry + '.returned.size'] = metadata.size; |
234 var entrySizeString = this.getSymbolString(entry + '.returne
d.size'); | 234 var entrySizeString = this.getSymbolString(entry + '.returne
d.size'); |
235 var expectedSizeString = this.getSymbolString(entry + '.size
'); | 235 var expectedSizeString = this.getSymbolString(entry + '.size
'); |
236 shouldBe.apply(this, [expectedSizeString, entrySizeString]); | 236 shouldBe.apply(this, [expectedSizeString, entrySizeString]); |
237 } | 237 } |
238 this.runNextTest(); | 238 this.runNextTest(); |
239 } else | 239 } else |
240 testFailed('Unexpectedly succeeded while ' + this.stage); | 240 testFailed('Unexpectedly succeeded while ' + this.stage); |
241 }; | 241 }; |
242 | 242 |
243 this.testErrorCallback = function(error) | 243 this.testErrorCallback = function(error) |
244 { | 244 { |
245 if (this.expectedErrorCode) { | 245 if (this.expectedError) { |
246 shouldBe.apply(this, ['this.expectedErrorCode + ""', '"' + error
.code + '"']); | 246 shouldBe.apply(this, ['this.expectedError + ""', '"' + error.nam
e + '"']); |
247 this.runNextTest(); | 247 this.runNextTest(); |
248 } else { | 248 } else { |
249 testFailed('Got unexpected error ' + error.code + ' while ' + th
is.stage); | 249 testFailed('Got unexpected error ' + error.name + ' while ' + th
is.stage); |
250 this.errorCallback(error); | 250 this.errorCallback(error); |
251 } | 251 } |
252 }; | 252 }; |
253 | 253 |
254 // Operations --------------------------------------------------- | 254 // Operations --------------------------------------------------- |
255 | 255 |
256 this.getFile = function(entry, path, flags, expectedErrorCode) | 256 this.getFile = function(entry, path, flags, expectedError) |
257 { | 257 { |
258 this.expectedErrorCode = expectedErrorCode; | 258 this.expectedError = expectedError; |
259 this.stage = '"' + entry + '".getFile("' + path + '")'; | 259 this.stage = '"' + entry + '".getFile("' + path + '")'; |
260 var successCallback = (flags && flags.create) ? this.testCreateSucce
ssCallback : this.testGetSuccessCallback; | 260 var successCallback = (flags && flags.create) ? this.testCreateSucce
ssCallback : this.testGetSuccessCallback; |
261 this.environment[entry].getFile(path, flags, bindCallback(this, succ
essCallback), bindCallback(this, this.testErrorCallback)); | 261 this.environment[entry].getFile(path, flags, bindCallback(this, succ
essCallback), bindCallback(this, this.testErrorCallback)); |
262 }; | 262 }; |
263 | 263 |
264 this.getDirectory = function(entry, path, flags, expectedErrorCode) | 264 this.getDirectory = function(entry, path, flags, expectedError) |
265 { | 265 { |
266 this.expectedErrorCode = expectedErrorCode; | 266 this.expectedError = expectedError; |
267 this.stage = '"' + entry + '".getDirectory("' + path + '")'; | 267 this.stage = '"' + entry + '".getDirectory("' + path + '")'; |
268 var successCallback = (flags && flags.create) ? this.testCreateSucce
ssCallback : this.testGetSuccessCallback; | 268 var successCallback = (flags && flags.create) ? this.testCreateSucce
ssCallback : this.testGetSuccessCallback; |
269 this.environment[entry].getDirectory(path, flags, bindCallback(this,
successCallback), bindCallback(this, this.testErrorCallback)); | 269 this.environment[entry].getDirectory(path, flags, bindCallback(this,
successCallback), bindCallback(this, this.testErrorCallback)); |
270 }; | 270 }; |
271 | 271 |
272 this.getParent = function(entry, expectedErrorCode) | 272 this.getParent = function(entry, expectedError) |
273 { | 273 { |
274 this.expectedErrorCode = expectedErrorCode; | 274 this.expectedError = expectedError; |
275 this.stage = '"' + entry + '".getParent()'; | 275 this.stage = '"' + entry + '".getParent()'; |
276 this.environment[entry].getParent(bindCallback(this, this.testGetPar
entSuccessCallback), bindCallback(this, this.testErrorCallback)); | 276 this.environment[entry].getParent(bindCallback(this, this.testGetPar
entSuccessCallback), bindCallback(this, this.testErrorCallback)); |
277 }; | 277 }; |
278 | 278 |
279 this.getMetadata = function(entry, expectedErrorCode) | 279 this.getMetadata = function(entry, expectedError) |
280 { | 280 { |
281 this.expectedErrorCode = expectedErrorCode; | 281 this.expectedError = expectedError; |
282 this.stage = '"' + entry + '".getMetadata()'; | 282 this.stage = '"' + entry + '".getMetadata()'; |
283 this.environment[entry].getMetadata(bindCallback(this, this.testMeta
dataSuccessCallback, entry), bindCallback(this, this.testErrorCallback)); | 283 this.environment[entry].getMetadata(bindCallback(this, this.testMeta
dataSuccessCallback, entry), bindCallback(this, this.testErrorCallback)); |
284 }; | 284 }; |
285 | 285 |
286 this.remove = function(entry, expectedErrorCode) | 286 this.remove = function(entry, expectedError) |
287 { | 287 { |
288 this.expectedErrorCode = expectedErrorCode; | 288 this.expectedError = expectedError; |
289 this.stage = '"' + entry + '".remove()'; | 289 this.stage = '"' + entry + '".remove()'; |
290 this.environment[entry].remove(bindCallback(this, this.testSuccessCa
llback), bindCallback(this, this.testErrorCallback)); | 290 this.environment[entry].remove(bindCallback(this, this.testSuccessCa
llback), bindCallback(this, this.testErrorCallback)); |
291 }; | 291 }; |
292 | 292 |
293 this.removeRecursively = function(entry, expectedErrorCode) | 293 this.removeRecursively = function(entry, expectedError) |
294 { | 294 { |
295 this.expectedErrorCode = expectedErrorCode; | 295 this.expectedError = expectedError; |
296 this.stage = '"' + entry + '".removeRecursively()'; | 296 this.stage = '"' + entry + '".removeRecursively()'; |
297 this.environment[entry].removeRecursively(bindCallback(this, this.te
stSuccessCallback), bindCallback(this, this.testErrorCallback)); | 297 this.environment[entry].removeRecursively(bindCallback(this, this.te
stSuccessCallback), bindCallback(this, this.testErrorCallback)); |
298 }; | 298 }; |
299 | 299 |
300 this.readDirectory = function(entry, expectedErrorCode) | 300 this.readDirectory = function(entry, expectedError) |
301 { | 301 { |
302 this.expectedErrorCode = expectedErrorCode; | 302 this.expectedError = expectedError; |
303 this.readEntries = []; | 303 this.readEntries = []; |
304 this.stage = '"' + entry + '".createReader().readEntries()'; | 304 this.stage = '"' + entry + '".createReader().readEntries()'; |
305 this.currentReader = this.environment[entry].createReader(); | 305 this.currentReader = this.environment[entry].createReader(); |
306 this.currentReader.readEntries(bindCallback(this, this.testReadEntri
esSuccessCallback), bindCallback(this, this.testErrorCallback)); | 306 this.currentReader.readEntries(bindCallback(this, this.testReadEntri
esSuccessCallback), bindCallback(this, this.testErrorCallback)); |
307 }; | 307 }; |
308 | 308 |
309 this.copy = function(entry, destinationParent, newName, expectedErrorCod
e) | 309 this.copy = function(entry, destinationParent, newName, expectedError) |
310 { | 310 { |
311 this.expectedErrorCode = expectedErrorCode; | 311 this.expectedError = expectedError; |
312 this.stage = '"' + entry + '".copyTo("' + destinationParent + '", "'
+ newName + '")'; | 312 this.stage = '"' + entry + '".copyTo("' + destinationParent + '", "'
+ newName + '")'; |
313 this.environment[entry].copyTo(this.environment[destinationParent],
newName, bindCallback(this, this.testSuccessCallback), bindCallback(this, this.t
estErrorCallback)); | 313 this.environment[entry].copyTo(this.environment[destinationParent],
newName, bindCallback(this, this.testSuccessCallback), bindCallback(this, this.t
estErrorCallback)); |
314 }; | 314 }; |
315 | 315 |
316 this.move = function(entry, destinationParent, newName, expectedErrorCod
e) | 316 this.move = function(entry, destinationParent, newName, expectedError) |
317 { | 317 { |
318 this.expectedErrorCode = expectedErrorCode; | 318 this.expectedError = expectedError; |
319 this.stage = '"' + entry + '".moveTo("' + destinationParent + '", "'
+ newName + '")'; | 319 this.stage = '"' + entry + '".moveTo("' + destinationParent + '", "'
+ newName + '")'; |
320 this.environment[entry].moveTo(this.environment[destinationParent],
newName, bindCallback(this, this.testSuccessCallback), bindCallback(this, this.t
estErrorCallback)); | 320 this.environment[entry].moveTo(this.environment[destinationParent],
newName, bindCallback(this, this.testSuccessCallback), bindCallback(this, this.t
estErrorCallback)); |
321 }; | 321 }; |
322 | 322 |
323 this.shouldBe = function(symbol1, symbol2) | 323 this.shouldBe = function(symbol1, symbol2) |
324 { | 324 { |
325 shouldBe.apply(this, [this.getSymbolString(symbol1), this.getSymbolS
tring(symbol2)]); | 325 shouldBe.apply(this, [this.getSymbolString(symbol1), this.getSymbolS
tring(symbol2)]); |
326 this.runNextTest(); | 326 this.runNextTest(); |
327 }; | 327 }; |
328 | 328 |
329 this.shouldBeGreaterThanOrEqual = function(symbol1, symbol2) | 329 this.shouldBeGreaterThanOrEqual = function(symbol1, symbol2) |
330 { | 330 { |
331 shouldBeGreaterThanOrEqual.apply(this, [this.getSymbolString(symbol1
), this.getSymbolString(symbol2)]); | 331 shouldBeGreaterThanOrEqual.apply(this, [this.getSymbolString(symbol1
), this.getSymbolString(symbol2)]); |
332 this.runNextTest(); | 332 this.runNextTest(); |
333 }; | 333 }; |
334 | 334 |
335 //--------------------------------------------------------------- | 335 //--------------------------------------------------------------- |
336 this.start = function() | 336 this.start = function() |
337 { | 337 { |
338 this.expectedErrorCode = ''; | 338 this.expectedError = ''; |
339 this.stage = 'resetting filesystem'; | 339 this.stage = 'resetting filesystem'; |
340 // Record rounded start date (current time minus 999 msec) here for
the comparison. Entry.getMetadata() may return the last mod time in seconds accu
racy while new Date() is milliseconds accuracy. | 340 // Record rounded start date (current time minus 999 msec) here for
the comparison. Entry.getMetadata() may return the last mod time in seconds accu
racy while new Date() is milliseconds accuracy. |
341 this.roundedStartDate = new Date((new Date()).getTime() - 999); | 341 this.roundedStartDate = new Date((new Date()).getTime() - 999); |
342 removeAllInDirectory(this.fileSystem.root, bindCallback(this, this.s
etUp), bindCallback(this, this.testErrorCallback)); | 342 removeAllInDirectory(this.fileSystem.root, bindCallback(this, this.s
etUp), bindCallback(this, this.testErrorCallback)); |
343 }; | 343 }; |
344 | 344 |
345 this.setUp = function() | 345 this.setUp = function() |
346 { | 346 { |
347 this.expectedErrorCode = ''; | 347 this.expectedError = ''; |
348 this.stage = 'setting up test precondition'; | 348 this.stage = 'setting up test precondition'; |
349 createTestEnvironment(this.fileSystem, this.testCase.precondition, b
indCallback(this, this.runTests), bindCallback(this, this.testErrorCallback)); | 349 createTestEnvironment(this.fileSystem, this.testCase.precondition, b
indCallback(this, this.runTests), bindCallback(this, this.testErrorCallback)); |
350 }; | 350 }; |
351 | 351 |
352 this.runNextTest = function() | 352 this.runNextTest = function() |
353 { | 353 { |
354 if (this.currentTest >= this.testCase.tests.length) { | 354 if (this.currentTest >= this.testCase.tests.length) { |
355 this.verify(); | 355 this.verify(); |
356 return; | 356 return; |
357 } | 357 } |
358 this.testCase.tests[this.currentTest++](this); | 358 this.testCase.tests[this.currentTest++](this); |
359 }; | 359 }; |
360 | 360 |
361 this.runTests = function(environment) | 361 this.runTests = function(environment) |
362 { | 362 { |
363 this.environment = environment; | 363 this.environment = environment; |
364 this.environment['/'] = this.fileSystem.root; | 364 this.environment['/'] = this.fileSystem.root; |
365 this.currentTest = 0; | 365 this.currentTest = 0; |
366 this.runNextTest(); | 366 this.runNextTest(); |
367 }; | 367 }; |
368 | 368 |
369 this.verify = function() | 369 this.verify = function() |
370 { | 370 { |
371 this.expectedErrorCode = ''; | 371 this.expectedError = ''; |
372 if (!this.testCase.postcondition) { | 372 if (!this.testCase.postcondition) { |
373 this.successCallback(); | 373 this.successCallback(); |
374 return; | 374 return; |
375 } | 375 } |
376 this.stage = 'verifying test postcondition'; | 376 this.stage = 'verifying test postcondition'; |
377 verifyTestEnvironment(this.fileSystem, this.testCase.postcondition,
this.successCallback, bindCallback(this, this.testErrorCallback)); | 377 verifyTestEnvironment(this.fileSystem, this.testCase.postcondition,
this.successCallback, bindCallback(this, this.testErrorCallback)); |
378 }; | 378 }; |
379 }; | 379 }; |
380 | 380 |
381 var helper = new OperationTestHelper(fileSystem, testCase, successCallback,
errorCallback); | 381 var helper = new OperationTestHelper(fileSystem, testCase, successCallback,
errorCallback); |
382 helper.start(); | 382 helper.start(); |
383 } | 383 } |
384 | 384 |
385 var currentTest = 0; | 385 var currentTest = 0; |
386 var fileSystem = null; | 386 var fileSystem = null; |
387 function runNextTest() { | 387 function runNextTest() { |
388 if (currentTest >= testCases.length) { | 388 if (currentTest >= testCases.length) { |
389 debug('Finished running tests.'); | 389 debug('Finished running tests.'); |
390 finishJSTest(); | 390 finishJSTest(); |
391 return; | 391 return; |
392 } | 392 } |
393 | 393 |
394 var testCase = testCases[currentTest++]; | 394 var testCase = testCases[currentTest++]; |
395 debug('* Running: ' + testCase.name); | 395 debug('* Running: ' + testCase.name); |
396 runOperationTest(fileSystem, testCase, runNextTest, errorCallback); | 396 runOperationTest(fileSystem, testCase, runNextTest, errorCallback); |
397 } | 397 } |
398 | 398 |
399 function errorCallback(error) { | 399 function errorCallback(error) { |
400 if (error && error.code) | 400 if (error && error.name) |
401 testFailed('Got error ' + error.code); | 401 testFailed('Got error ' + error.name); |
402 finishJSTest(); | 402 finishJSTest(); |
403 } | 403 } |
404 | 404 |
405 function fileSystemCallback(fs) | 405 function fileSystemCallback(fs) |
406 { | 406 { |
407 fileSystem = fs; | 407 fileSystem = fs; |
408 runNextTest(); | 408 runNextTest(); |
409 } | 409 } |
410 | 410 |
411 var jsTestIsAsync = true; | 411 var jsTestIsAsync = true; |
412 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); | 412 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); |
OLD | NEW |