blob: 96f4b65f6471772037b77b24809b19867d3bd833 [file] [log] [blame]
Verify that a transaction with an error aborts unless preventDefault() is called.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
webkitIndexedDB.open('error-causes-abort-by-default')
db = event.target.result
db.setVersion('new version')
setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
trans.oncomplete = addData
Deleted all object stores.
db.createObjectStore('storeName', null)
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = unexpectedAbortCallback
trans.oncomplete = transactionCompleted
store = trans.objectStore('storeName')
store.add({x: 'value', y: 'zzz'}, 'key')
event.target.source.add({x: 'value', y: 'zzz'}, 'key')
event.preventDefault()
PASS Transaction completed
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted1
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value', y: 'zzz'}, 'key')
Doing nothing to prevent the default action...
PASS Transaction aborted
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted2
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value', y: 'zzz'}, 'key')
Omitting an onerror handler
PASS Transaction aborted
PASS successfullyParsed is true
TEST COMPLETE