1 Test mutating an IndexedDB's objectstore from a cursor.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "mutating-cursor.html"
7 indexedDB.deleteDatabase(dbname)
9 objectStore = db.createObjectStore('store')
10 objectStore.add(1, 1).onerror = unexpectedErrorCallback
11 objectStore.add(2, 2).onerror = unexpectedErrorCallback
12 objectStore.add(3, 3).onerror = unexpectedErrorCallback
13 objectStore.add(4, 4).onerror = unexpectedErrorCallback
15 trans = db.transaction(['store'], 'readwrite')
16 trans.objectStore('store')
17 objectStore.openCursor()
20 PASS cursor.key is cursorSteps
21 PASS cursor.value is cursorSteps
22 event.target.source.add(5, 5)
26 PASS cursor.key is cursorSteps
27 PASS cursor.value is cursorSteps
31 PASS cursor.key is cursorSteps
32 PASS cursor.value is cursorSteps
36 PASS cursor.key is cursorSteps
37 PASS cursor.value is cursorSteps
41 PASS cursor.key is cursorSteps
42 PASS cursor.value is cursorSteps
46 forwardCursorComplete()
48 trans = db.transaction(['store'], 'readwrite')
49 trans.objectStore('store')
50 objectStore.openCursor(null, 'prev')
53 PASS cursor.key is cursorSteps
54 PASS cursor.value is cursorSteps
58 PASS cursor.key is cursorSteps
59 PASS cursor.value is cursorSteps
63 PASS cursor.key is cursorSteps
64 PASS cursor.value is cursorSteps
68 PASS cursor.key is cursorSteps
69 PASS cursor.value is cursorSteps
70 event.target.source.add(0, 0)
74 PASS cursor.key is cursorSteps
75 PASS cursor.value is cursorSteps
79 PASS cursor.key is cursorSteps
80 PASS cursor.value is cursorSteps
84 reverseCursorComplete()
85 PASS successfullyParsed is true