Test the order when there are pending open (with upgrade) and delete calls.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "deletedatabase-delayed-by-versionchange.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
h1OpenSuccess():
openWithUpgradeBlockedEventFired = false
upgradeComplete = false
deleteDatabaseBlockedEventFired = false
deleteDatabaseComplete = false
h1 = event.target.result
Open h2:
indexedDB.open(dbname)
h2OpenSuccess():
h2OpenSuccess = true
Open h3:
indexedDB.open(dbname, 2)
... and deleteDatabase()
indexedDB.deleteDatabase(dbname)
h1OnVersionChange():
PASS event.target.version is 1
PASS event.oldVersion is 1
PASS event.newVersion is 2
h2OnVersionChange():
PASS event.target.version is 1
PASS event.oldVersion is 1
PASS event.newVersion is 2
h3Blocked():
openWithUpgradeBlockedEventFired = true
Open h4:
indexedDB.open(dbname)
Close connections to unblock previous requests:
h1.close()
h2.close()
h3OnUpgradeneeded():
transactionOnComplete():
upgradeComplete = true
h3OpenSuccess():
PASS upgradeComplete is true
PASS deleteDatabaseBlockedEventFired is false
PASS deleteDatabaseComplete is false
h3.close()
deleteDatabaseOnSuccess():
deleteDatabaseComplete = true
PASS openWithUpgradeBlockedEventFired is true
PASS upgradeComplete is true
deleteDatabaseBlockedEventFired = true
h4OpenSuccess():
PASS deleteDatabaseBlockedEventFired is true
PASS deleteDatabaseComplete is true
PASS successfullyParsed is true
TEST COMPLETE