blob: abf31f7547bd12b28ddc6347753f7a9cf26e1829 [file] [log] [blame]
Call db.close() in the complete handler for a version change transaction, before the success event associated with the open call fires
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)
request = indexedDB.open(dbname, 7)
upgradeNeeded():
db = event.target.result
PASS event.newVersion is 7
db.createObjectStore('os')
transaction = event.target.transaction
transaction.oncomplete:
sawTransactionComplete = true
db.close()
openError():
PASS sawTransactionComplete is true
PASS event.target.result is undefined.
PASS event.target.error.name is "AbortError"
Expecting exception from transaction = db.transaction('os', 'readwrite')
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