blob: 61f005d6851677a465d29e75b15f0f512fd9b329 [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 connection's 'versionchange' 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
Closing the connection before the IDBOpenDBRequest's success fires will cause the open to fail.
db.close()
deleteSuccessCallback():
PASS sawVersionChange is true
PASS sawDeleteBlocked is false
PASS sawUpgradeNeeded is true
PASS successfullyParsed is true
TEST COMPLETE