blob: edba7c2c61654a165062b8c5789c6b38ffe48c74 [file] [log] [blame]
Test that an aborted 'versionchange' transaction closes the connection.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "aborted-versionchange-closes.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname, 1)
prepareDatabase():
db = event.target.result
db.createObjectStore('store')
onOpen():
db = event.target.result
db.close()
openAgain():
request = indexedDB.open(dbname, 2)
onUpgradeNeeded():
db = event.target.result
transaction = event.target.transaction
sawTransactionAbort = false
onTransactionAbort():
sawTransactionAbort = true
creating a transaction should fail because connection is closed:
Expecting exception from db.transaction('store')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
onOpenError():
PASS sawTransactionAbort is true
creating a transaction should fail because connection is closed:
Expecting exception from db.transaction('store')
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Exception message: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
PASS successfullyParsed is true
TEST COMPLETE