Test that a deleteDatabase called while handling an upgradeneeded event is queued and fires its events at the right time. The close() call to unblock the delete occurs in the connection's 'versionchange' event handler.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "delete-in-upgradeneeded-close-in-versionchange.html"
indexedDB.deleteDatabase(dbname)
initiallyDeleted():
request = indexedDB.open(dbname, 1)
upgradeNeededCallback():
PASS sawUpgradeNeeded is false
PASS sawOpenSuccess is false
sawUpgradeNeeded = true
PASS event.oldVersion is 0
PASS event.newVersion is 1
db = event.target.result
deleteRequest = indexedDB.deleteDatabase(dbname)
request2.onsuccess = deleteSuccessCallback
openSuccessCallback():
PASS sawUpgradeNeeded is true
PASS sawVersionChange is false
sawOpenSuccess = true
versionChangeCallback():
PASS sawOpenSuccess is true
PASS event.oldVersion is 1
PASS event.newVersion is null
sawVersionChange = true
db.close()
deleteSuccessCallback():
PASS sawVersionChange is true
PASS sawUpgradeNeeded is true
PASS successfullyParsed is true
TEST COMPLETE