Test the basics of IndexedDB's IDBCursor objects.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "cursor-basics.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
prepareDatabase():
store = db.createObjectStore('storeName')
index = store.createIndex('indexName', 'indexOn')
store.put({indexOn: 'a'}, 0)
store.openCursor()
store.openKeyCursor()
index.openCursor()
index.openKeyCursor()
onStoreOpenCursor():
cursor = event.target.result
PASS cursor is non-null.
PASS cursor instanceof IDBCursor is true
PASS 'key' in cursor is true
PASS 'primaryKey' in cursor is true
PASS 'continue' in cursor is true
PASS typeof cursor.continue is "function"
PASS 'continuePrimaryKey' in cursor is true
PASS typeof cursor.continuePrimaryKey is "function"
PASS 'advance' in cursor is true
PASS typeof cursor.advance is "function"
PASS 'update' in cursor is true
PASS typeof cursor.update is "function"
PASS 'delete' in cursor is true
PASS typeof cursor.delete is "function"
PASS cursor.key is 0
PASS cursor.primaryKey is 0
PASS cursor instanceof IDBCursorWithValue is true
PASS 'value' in cursor is true
PASS JSON.stringify(cursor.value) is "{\"indexOn\":\"a\"}"
onStoreOpenKeyCursor():
cursor = event.target.result
PASS cursor is non-null.
PASS cursor instanceof IDBCursor is true
PASS 'key' in cursor is true
PASS 'primaryKey' in cursor is true
PASS 'continue' in cursor is true
PASS typeof cursor.continue is "function"
PASS 'continuePrimaryKey' in cursor is true
PASS typeof cursor.continuePrimaryKey is "function"
PASS 'advance' in cursor is true
PASS typeof cursor.advance is "function"
PASS 'update' in cursor is true
PASS typeof cursor.update is "function"
PASS 'delete' in cursor is true
PASS typeof cursor.delete is "function"
PASS cursor.key is 0
PASS 'primaryKey' in cursor is true
PASS cursor.primaryKey is 0
PASS cursor instanceof IDBCursorWithValue is false
PASS 'value' in cursor is false
onIndexOpenCursor():
cursor = event.target.result
PASS cursor is non-null.
PASS cursor instanceof IDBCursor is true
PASS 'key' in cursor is true
PASS 'primaryKey' in cursor is true
PASS 'continue' in cursor is true
PASS typeof cursor.continue is "function"
PASS 'continuePrimaryKey' in cursor is true
PASS typeof cursor.continuePrimaryKey is "function"
PASS 'advance' in cursor is true
PASS typeof cursor.advance is "function"
PASS 'update' in cursor is true
PASS typeof cursor.update is "function"
PASS 'delete' in cursor is true
PASS typeof cursor.delete is "function"
PASS cursor.key is "a"
PASS cursor.primaryKey is 0
PASS cursor instanceof IDBCursorWithValue is true
PASS 'value' in cursor is true
PASS JSON.stringify(cursor.value) is "{\"indexOn\":\"a\"}"
onIndexOpenKeyCursor():
cursor = event.target.result
PASS cursor is non-null.
PASS cursor instanceof IDBCursor is true
PASS 'key' in cursor is true
PASS 'primaryKey' in cursor is true
PASS 'continue' in cursor is true
PASS typeof cursor.continue is "function"
PASS 'continuePrimaryKey' in cursor is true
PASS typeof cursor.continuePrimaryKey is "function"
PASS 'advance' in cursor is true
PASS typeof cursor.advance is "function"
PASS 'update' in cursor is true
PASS typeof cursor.update is "function"
PASS 'delete' in cursor is true
PASS typeof cursor.delete is "function"
PASS cursor.key is "a"
PASS cursor.primaryKey is 0
PASS cursor instanceof IDBCursorWithValue is false
PASS cursor.primaryKey is 0
PASS 'value' in cursor is false
PASS successfullyParsed is true
TEST COMPLETE