blob: edda6206ead96befcfee56f8ddaecc2b2f156b60 [file] [log] [blame]
Test IndexedDB's openCursor.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
webkitIndexedDB.open('cursor-delete')
db = event.target.result
db.setVersion('new version')
setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
Deleted all object stores.
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'], webkitIDBTransaction.READ_WRITE)
trans.objectStore('test').openCursor({range: 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'], webkitIDBTransaction.READ_WRITE)
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