blob: 8edde015b0bed0a96862efe027f127ff3efb2a21 [file] [log] [blame]
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').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').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