blob: dce8762a782d948070502133adf9942fec757e27 [file] [log] [blame]
Test that when db.close is called in upgradeneeded, the db is cleaned up on refresh.
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
transaction = event.target.transaction
db.createObjectStore('os')
db.close()
transaction.oncomplete:
sawTransactionComplete = true
openError():
PASS sawTransactionComplete is true
PASS event.target.error.name is 'AbortError'
PASS event.result is undefined
Verify that the old connection is unchanged and was closed:
PASS db is non-null.
PASS db.version is 7
Expecting exception from db.transaction('os')
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