Test IndexedDB's openCursor.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "cursor-delete.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
setVersionSuccess():
trans = event.target.result
PASS trans is non-null.
objectStore = db.createObjectStore('test')
objectStore.add('myValue1', 'myKey1')
objectStore.add('myValue2', 'myKey2')
objectStore.add('myValue3', 'myKey3')
objectStore.add('myValue4', 'myKey4')
openCursor1
trans = db.transaction(['test'], 'readwrite')
trans.objectStore('test').openCursor(keyRange)
event.target.result.delete()
PASS event.target.result.value is "myValue1"
event.target.result.continue()
event.target.result.delete()
PASS event.target.result.value is "myValue2"
event.target.result.continue()
event.target.result.delete()
PASS event.target.result.value is "myValue3"
event.target.result.continue()
event.target.result.delete()
PASS event.target.result.value is "myValue4"
event.target.result.continue()
PASS counter is 5
trans.objectStore('test').openCursor(keyRange)
PASS event.target.result is null
trans = db.transaction(['test'], 'readwrite')
objectStore = trans.objectStore('test')
objectStore.add('myValue1', 'myKey1')
openCursor2
objectStore.openCursor(keyRange)
PASS [object IDBCursorWithValue] is non-null.
event.target.result.delete()
objectStore.get('myKey1')
PASS event.target.result is undefined
PASS successfullyParsed is true
TEST COMPLETE