1 Test IndexedDB's openCursor. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 webkitIndexedDB.open('cursor-index-delete') 7 db = event.target.result 8 db.setVersion('new version') 9 setVersionSuccess(): 10 trans = event.target.result 11 PASS trans !== null is true 12 Deleted all object stores. 13 objectStore = db.createObjectStore('test') 14 objectStore.createIndex('testIndex', 'x') 15 objectStore.add({x: 1}, 'myKey1') 16 objectStore.add({x: 2}, 'myKey2') 17 objectStore.add({x: 3}, 'myKey3') 18 objectStore.add({x: 4}, 'myKey4') 19 openCursor1 20 trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE) 21 trans.objectStore('test').index('testIndex').openCursor(keyRange) 22 event.target.result.delete() 23 PASS event.target.result.key is counter++ 24 event.target.result.continue() 25 event.target.result.delete() 26 PASS event.target.result.key is counter++ 27 event.target.result.continue() 28 event.target.result.delete() 29 PASS event.target.result.key is counter++ 30 event.target.result.continue() 31 event.target.result.delete() 32 PASS event.target.result.key is counter++ 33 event.target.result.continue() 34 PASS counter is 5 35 trans.objectStore('test').index('testIndex').openCursor(keyRange) 36 PASS event.target.result is null 37 trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE) 38 objectStore = trans.objectStore('test') 39 objectStore.add({x: 1}, 'myKey1') 40 openCursor2 41 index = event.target.source.index('testIndex') 42 index.openCursor(keyRange) 43 PASS [object IDBCursorWithValue] is non-null. 44 event.target.result.delete() 45 index.get(1) 46 event.preventDefault() 47 PASS successfullyParsed is true 48 49 TEST COMPLETE 50 51