blob: df2ee7fb7bdd94e0f4a1b86952d39a5db5e0340a [file] [log] [blame]
Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor().
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)
store = db.createObjectStore('store')
index = store.createIndex('index', 'value')
store.put({value: 0}, 0)
verifyOverloads():
trans = db.transaction('store')
store = trans.objectStore('store')
index = store.index('index')
store.openCursor()
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
store.openCursor(0)
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
store.openCursor(0, 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
store.openCursor(0, 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
store.openCursor(0, 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
store.openCursor(0, 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
store.openCursor(IDBKeyRange.only(0))
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
store.openCursor(IDBKeyRange.only(0), 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
store.openCursor(IDBKeyRange.only(0), 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
store.openCursor(IDBKeyRange.only(0), 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
store.openCursor(IDBKeyRange.only(0), 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
index.openCursor()
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openCursor(0)
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openCursor(0, 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openCursor(0, 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
index.openCursor(0, 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
index.openCursor(0, 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
index.openCursor(IDBKeyRange.only(0))
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openCursor(IDBKeyRange.only(0), 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openCursor(IDBKeyRange.only(0), 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
index.openCursor(IDBKeyRange.only(0), 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
index.openCursor(IDBKeyRange.only(0), 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
index.openKeyCursor()
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openKeyCursor(0)
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openKeyCursor(0, 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openKeyCursor(0, 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
index.openKeyCursor(0, 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
index.openKeyCursor(0, 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
index.openKeyCursor(IDBKeyRange.only(0))
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openKeyCursor(IDBKeyRange.only(0), 'next')
PASS event.target.result is non-null.
PASS event.target.result.direction is "next"
index.openKeyCursor(IDBKeyRange.only(0), 'nextunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "nextunique"
index.openKeyCursor(IDBKeyRange.only(0), 'prev')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prev"
index.openKeyCursor(IDBKeyRange.only(0), 'prevunique')
PASS event.target.result is non-null.
PASS event.target.result.direction is "prevunique"
PASS successfullyParsed is true
TEST COMPLETE