CONSOLE MESSAGE: line 92: Uncaught Error: This should *NOT* be caught!
Test IDBTransaction.error cases.

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 = self.location.pathname
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
db = request.result
db.setVersion('1')
trans = event.target.result
store = db.createObjectStore('storeName')
store.add('value', 'key')

trans = db.transaction('storeName')

IDBTransaction.error should be null if transaction is not finished:
PASS trans.error is null

If IDBTransaction.abort() is explicitly called, IDBTransaction.error should be null:
trans.abort()
PASS trans.error is null

If the transaction is aborted due to a request error that is not prevented, IDBTransaction.error should match:
trans = db.transaction('storeName', 'readwrite')
request = trans.objectStore('storeName').add('value2', 'key')
PASS request.errorCode is IDBDatabaseException.CONSTRAINT_ERR
PASS request.error.name is 'ConstraintError'
request_error = request.error
Transaction received abort event.
PASS trans.error is non-null.
PASS trans.error is request_error

If the transaction is aborted due to an exception thrown from event callback, IDBTransaction.error should be AbortError:
trans = db.transaction('storeName', 'readwrite')
request = trans.objectStore('storeName').add('value2', 'key')
PASS request.errorCode is IDBDatabaseException.CONSTRAINT_ERR
PASS request.error.name is 'ConstraintError'
Throwing exception...
Transaction received abort event.
PASS trans.error is non-null.
PASS trans.error.name is 'AbortError'

If the transaction is aborted due to an error during commit, IDBTransaction.error should reflect that error:
trans = db.transaction('storeName', 'readwrite')
request = trans.objectStore('storeName').add({id: 1}, 'record1')
request = trans.objectStore('storeName').add({id: 1}, 'record2')
request = db.setVersion('2')
trans = request.result
This should fail due to the unique constraint:
trans.objectStore('storeName').createIndex('indexName', 'id', {unique: true})
Transaction received abort event.
PASS trans.error is non-null.
PASS trans.error.name is not 'AbortError'

PASS successfullyParsed is true

TEST COMPLETE

