blob: 9c2f8588aedfa8658ea0ff6a7e13cfc325c9d9f0 [file] [log] [blame]
Verify that that cursors accessed after being closed are well behaved
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
prepareDatabase():
db = event.target.result
store = db.createObjectStore('store')
store.put({value: 'value'}, ['key'])
onOpen():
db = event.target.result
tx = db.transaction('store')
store = tx.objectStore('store')
cursorRequest = store.openCursor()
openCursorSuccess():
cursor = cursorRequest.result
Don't continue the cursor, so it retains its key/primaryKey/value
transactionComplete():
PASS JSON.stringify(cursor.key) is "[\"key\"]"
PASS JSON.stringify(cursor.primaryKey) is "[\"key\"]"
PASS JSON.stringify(cursor.value) is "{\"value\":\"value\"}"
PASS successfullyParsed is true
TEST COMPLETE