blob: 8e9b1247ea4b2748f0aeb4ec9b55c43129fd003e [file] [log] [blame]
Test that blocked events get delivered properly with the new open api
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)
deleteSuccess():
request = indexedDB.open(dbname, 2)
firstUpgradeNeededCallback():
gotFirstUpgradeNeededEvent = true
PASS event.oldVersion is 0
PASS event.newVersion is 2
PASS String(event) is "[object IDBVersionChangeEvent]"
firstSuccessEventHandler():
PASS gotFirstUpgradeNeededEvent is true
connection1 = event.target.result
connection1.onversionchange = versionChangeHandler
PASS String(connection1) is "[object IDBDatabase]"
request = indexedDB.open(dbname, 3)
versionChangeHandler():
sawVersionChangeEvent = true
PASS event.type is "versionchange"
PASS String(event) is "[object IDBVersionChangeEvent]"
PASS event.target is connection1
PASS event.oldVersion is 2
PASS event.newVersion is 3
blockedEventHandler():
PASS sawVersionChangeEvent is true
gotBlockedEvent = true
PASS String(event) is "[object IDBVersionChangeEvent]"
PASS event.oldVersion is 2
PASS event.newVersion is 3
PASS event.type is "blocked"
connection1.close()
secondUpgradeNeededEventHandler():
PASS gotBlockedEvent is true
gotSecondUpgradeNeededEvent = true
secondSuccessCallback():
PASS gotSecondUpgradeNeededEvent is true
PASS successfullyParsed is true
TEST COMPLETE