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