1 Test IndexedDB's openCursor.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-delete.html"
7 indexedDB.deleteDatabase(dbname)
10 trans = event.target.result
11 PASS trans is non-null.
12 objectStore = db.createObjectStore('test')
13 objectStore.add('myValue1', 'myKey1')
14 objectStore.add('myValue2', 'myKey2')
15 objectStore.add('myValue3', 'myKey3')
16 objectStore.add('myValue4', 'myKey4')
18 trans = db.transaction(['test'], 'readwrite')
19 trans.objectStore('test').openCursor(keyRange)
20 event.target.result.delete()
21 PASS event.target.result.value is "myValue1"
22 event.target.result.continue()
23 event.target.result.delete()
24 PASS event.target.result.value is "myValue2"
25 event.target.result.continue()
26 event.target.result.delete()
27 PASS event.target.result.value is "myValue3"
28 event.target.result.continue()
29 event.target.result.delete()
30 PASS event.target.result.value is "myValue4"
31 event.target.result.continue()
33 trans.objectStore('test').openCursor(keyRange)
34 PASS event.target.result is null
35 trans = db.transaction(['test'], 'readwrite')
36 objectStore = trans.objectStore('test')
37 objectStore.add('myValue1', 'myKey1')
39 objectStore.openCursor(keyRange)
40 PASS [object IDBCursorWithValue] is non-null.
41 event.target.result.delete()
42 objectStore.get('myKey1')
43 PASS event.target.result is undefined
44 PASS successfullyParsed is true