chromium/third_party/blink/web_tests/storage/indexeddb/intversion-long-queue-expected.txt

Test that a database is recreated correctly when an open-with-version call is queued behind both a deleteDatabase and an open-with-version call

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

dbname = "intversion-long-queue.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)


prepareDatabase():
db = event.target.result


connection1Success():
connection1 = event.target.result
PASS db is connection1
connection1.onversionchange = connection1VersionChangeCallback
request = indexedDB.open(dbname, 2)
request.onsuccess = connection2Success
request.onupgradeneeded = connection2UpgradeNeeded
request.onblocked = connection2Blocked


connection1VersionChangeCallback():
PASS event.type is "versionchange"
PASS event.oldVersion is 1
PASS event.newVersion is 2


connection2Blocked():
request = indexedDB.deleteDatabase(dbname)
request.onsuccess = deleteDatabaseSuccessCallback
request = indexedDB.open(dbname, 3)
request.onupgradeneeded = connection3UpgradeNeeded
request.onsuccess = connection3Success
connection1.close()


connection2UpgradeNeeded():
PASS event.oldVersion is 1
PASS event.newVersion is 2
db = event.target.result
PASS db.objectStoreNames.length is 0
db.createObjectStore('some object store')
transaction = event.target.transaction
transaction.oncomplete = connection2TransactionComplete


connection2TransactionComplete():
PASS db.version is 2


connection2Success():
connection2 = event.target.result
connection2.close()


deleteDatabaseSuccessCallback():
PASS event.target.result is undefined.
PASS event.type is "success"


connection3UpgradeNeeded():
gotUpgradeNeededEvent = true
PASS event.newVersion is 3
PASS event.oldVersion is 0


connection3Success():
PASS gotUpgradeNeededEvent is true
PASS event.target.result.objectStoreNames.length is 0
PASS successfullyParsed is true

TEST COMPLETE