chromium/third_party/blink/web_tests/storage/indexeddb/aborted-versionchange-closes-expected.txt

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', 'readonly', {durability: 'relaxed'})
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', 'readonly', {durability: 'relaxed'})
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