| OLD | NEW |
| 1 if (this.importScripts) { | 1 if (this.importScripts) { |
| 2 importScripts('../../../fast/js/resources/js-test-pre.js'); | 2 importScripts('../../../fast/js/resources/js-test-pre.js'); |
| 3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
| 4 } | 4 } |
| 5 | 5 |
| 6 description("Test IndexedDB cursor.advance()."); | 6 description("Test IndexedDB cursor.advance()."); |
| 7 | 7 |
| 8 var objectStoreData = [ | 8 var objectStoreData = [ |
| 9 { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } }, | 9 { key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } }, |
| 10 { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } }, | 10 { key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } }, |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); | 323 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); |
| 324 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)")
; | 324 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)")
; |
| 325 | 325 |
| 326 evalAndLog("request = objectStore.openCursor()"); | 326 evalAndLog("request = objectStore.openCursor()"); |
| 327 | 327 |
| 328 function advanceBadly() | 328 function advanceBadly() |
| 329 { | 329 { |
| 330 cursor = event.target.result; | 330 cursor = event.target.result; |
| 331 | 331 |
| 332 evalAndExpectExceptionClass("cursor.advance(0)", "TypeError"); | 332 evalAndExpectExceptionClass("cursor.advance(0)", "TypeError"); |
| 333 evalAndExpectExceptionClass("cursor.advance(-1)", "TypeError"); |
| 334 evalAndExpectExceptionClass("cursor.advance(0x20000000000000)", "TypeErr
or"); |
| 333 testDelete(); | 335 testDelete(); |
| 334 } | 336 } |
| 335 request.onsuccess = advanceBadly; | 337 request.onsuccess = advanceBadly; |
| 336 request.onerror = unexpectedErrorCallback; | 338 request.onerror = unexpectedErrorCallback; |
| 337 | 339 |
| 338 } | 340 } |
| 339 | 341 |
| 340 function testDelete() | 342 function testDelete() |
| 341 { | 343 { |
| 342 debug("testDelete()"); | 344 debug("testDelete()"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 369 evalAndLog("cursor.advance(1)"); | 371 evalAndLog("cursor.advance(1)"); |
| 370 currentPos++; | 372 currentPos++; |
| 371 } | 373 } |
| 372 | 374 |
| 373 } | 375 } |
| 374 request.onsuccess = deleteSecond; | 376 request.onsuccess = deleteSecond; |
| 375 request.onerror = unexpectedErrorCallback; | 377 request.onerror = unexpectedErrorCallback; |
| 376 } | 378 } |
| 377 | 379 |
| 378 test(); | 380 test(); |
| OLD | NEW |