1 Test transaction aborts send the proper onabort messages..
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "transaction-abort.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('storeName', null)
10 store.add({x: 'value', y: 'zzz'}, 'key')
11 trans = db.transaction(['storeName'], 'readwrite')
12 trans.onabort = transactionAborted
13 trans.oncomplete = unexpectedCompleteCallback
14 store = trans.objectStore('storeName')
15 store.add({x: 'value2', y: 'zzz2'}, 'key2')
16 store.add({x: 'value3', y: 'zzz3'}, 'key3')
17 PASS event.target.error.name is 'AbortError'
18 PASS trans.error is null
19 PASS firstError is false
20 PASS secondError is false
21 PASS abortFired is false
22 Expecting exception from store.add({x: 'value4', y: 'zzz4'}, 'key4')
23 PASS Exception was thrown.
25 PASS ename is 'TransactionInactiveError'
26 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
27 PASS event.target.error.name is 'AbortError'
28 PASS trans.error is null
29 PASS firstError is true
30 PASS secondError is false
31 PASS abortFired is false
32 PASS firstError is true
33 PASS secondError is true
34 PASS abortFired is false
35 PASS trans.error is null
36 Expecting exception from store.add({x: 'value5', y: 'zzz5'}, 'key5')
37 PASS Exception was thrown.
39 PASS ename is 'TransactionInactiveError'
40 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
41 Expecting exception from trans.abort()
42 PASS Exception was thrown.
43 PASS code is DOMException.INVALID_STATE_ERR
44 PASS ename is 'InvalidStateError'
45 Exception message: Failed to execute 'abort' on 'IDBTransaction': The transaction has finished.
46 PASS successfullyParsed is true