文本文件  |  32行  |  845 B

Test IndexedDB's openCursor.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


webkitIndexedDB.open('open-cursor')
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('myValue', 'myKey')
Opening cursor
event.target.source.openCursor(keyRange)
Cursor opened successfully.
PASS event.target.result.direction is 0
PASS event.target.result.key is 'myKey'
PASS event.target.result.value is 'myValue'

Passing an invalid key into .continue().
PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17

Opening an empty cursor.
objectStore.openCursor(keyRange)
Empty cursor opened successfully.
PASS successfullyParsed is true

TEST COMPLETE