Test transaction aborts send the proper onabort messages..

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;

dbname = "transaction-abort.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
store = db.createObjectStore('storeName', null)
store.add({x: 'value', y: 'zzz'}, 'key')
trans = db.transaction(['storeName'], 'readwrite')
trans.onabort = transactionAborted
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value2', y: 'zzz2'}, 'key2')
store.add({x: 'value3', y: 'zzz3'}, 'key3')
PASS event.target.error.name is 'AbortError'
PASS trans.error is null
PASS firstError is false
PASS secondError is false
PASS abortFired is false
Expecting exception from store.add({x: 'value4', y: 'zzz4'}, 'key4')
PASS Exception was thrown.
PASS code is 0
PASS ename is 'TransactionInactiveError'
Exception message: A request was placed against a transaction which is either currently not active, or which is finished.
PASS event.target.error.name is 'AbortError'
PASS trans.error is null
PASS firstError is true
PASS secondError is false
PASS abortFired is false
PASS firstError is true
PASS secondError is true
PASS abortFired is false
PASS trans.error is null
Expecting exception from store.add({x: 'value5', y: 'zzz5'}, 'key5')
PASS Exception was thrown.
PASS code is 0
PASS ename is 'TransactionInactiveError'
Exception message: A request was placed against a transaction which is either currently not active, or which is finished.
Expecting exception from trans.abort()
PASS Exception was thrown.
PASS code is DOMException.INVALID_STATE_ERR
PASS ename is 'InvalidStateError'
Exception message: An operation was called on an object on which it is not allowed or at a time when it is not allowed.
PASS successfullyParsed is true

TEST COMPLETE

