blob: 4b9f869c1df290ac8b37fb69aaf66f0098797aea [file] [log] [blame]
CONSOLE MESSAGE: line 63: Uncaught this exception is expected
CONSOLE MESSAGE: line 63: Uncaught this exception is expected
Test exceptions in IDBRequest handlers cause aborts.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
webkitIndexedDB.open('exception-in-event-aborts')
db = event.target.result
db.setVersion('new version')
setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
trans.oncomplete = startTest
Deleted all object stores.
store = db.createObjectStore('storeName', null)
store.add({x: 'value', y: 'zzz'}, 'key')
trans = db.transaction(['storeName'], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted1
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value2', y: 'zzz2'}, 'key2')
event.preventDefault()
Throwing
PASS Got expected error: 'this exception is expected'
PASS The transaction was aborted.
trans = db.transaction(['storeName'], webkitIDBTransaction.READ_WRITE)
trans.onabort = transactionAborted2
trans.oncomplete = unexpectedCompleteCallback
store = trans.objectStore('storeName')
store.add({x: 'value', y: 'zzz'}, 'key')
event.preventDefault()
Throwing
PASS Got expected error: 'this exception is expected'
PASS The transaction was aborted.
trans = db.transaction(['storeName'], webkitIDBTransaction.READ_WRITE)
trans.onabort = unexpectedAbortCallback
trans.oncomplete = transactionCompleted1
store = trans.objectStore('storeName')
store.add({x: 'value3', y: 'zzz3'}, 'key3')
event.preventDefault()
Throwing within a try block
PASS The transaction completed.
trans = db.transaction(['storeName'], webkitIDBTransaction.READ_WRITE)
trans.onabort = unexpectedAbortCallback
trans.oncomplete = transactionCompleted2
store = trans.objectStore('storeName')
store.add({x: 'value4', y: 'zzz4'}, 'key4')
PASS key4 added
PASS The transaction completed.
PASS successfullyParsed is true
TEST COMPLETE