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