blob: 8b8605e81d2cde7e361a8562fd1e04147166e17d [file] [log] [blame]
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 open request's 'success' event handler.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
indexedDB.deleteDatabase(dbname)
initiallyDeleted():
request = indexedDB.open(dbname, 1)
upgradeNeededCallback():
PASS sawUpgradeNeeded 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
versionChangeCallback():
PASS event.oldVersion is 1
PASS event.newVersion is null
sawVersionChange = true
openSuccess():
PASS sawUpgradeNeeded is true
db = event.target.result
PASS db.version is 1
db.close()
deleteSuccessCallback():
PASS sawVersionChange is true
PASS sawDeleteBlocked is true
PASS successfullyParsed is true
TEST COMPLETE