Ensure IndexedDB's write operations invalidate cursor prefetch caches
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "prefetch-invalidation.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
prepareDatabase():
db = event.target.result
store = db.createObjectStore('store')
onOpenSuccess():
db = event.target.result
-------------------------------------------
doPrefetchInvalidationTest():
store = db.transaction('store', 'readwrite', {durability: 'relaxed'}).objectStore('store')
Populate the store with 200 records.
cursorRequest = store.openCursor()
continue100Times():
PASS cursorRequest.result is non-null.
doOperationAndContinue():
store.delete(IDBKeyRange.bound(-Infinity, +Infinity))
cursor = cursorRequest.result
cursor.continue()
onContinueSuccess():
PASS cursorRequest.result is null
-------------------------------------------
doPrefetchInvalidationTest():
store = db.transaction('store', 'readwrite', {durability: 'relaxed'}).objectStore('store')
Populate the store with 200 records.
cursorRequest = store.openCursor()
continue100Times():
PASS cursorRequest.result is non-null.
doOperationAndContinue():
store.clear()
cursor = cursorRequest.result
cursor.continue()
onContinueSuccess():
PASS cursorRequest.result is null
PASS successfullyParsed is true
TEST COMPLETE