blob: f5708747434304c8580d86b0e39183c027202317 [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
openSuccess():
PASS sawUpgradeNeeded is true
db = event.target.result
PASS db.version is 1
db.close()
deleteSuccessCallback():
PASS sawVersionChange is false
PASS sawDeleteBlocked is false
PASS successfullyParsed is true
TEST COMPLETE