• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Test transaction aborts send the proper onabort messages..
2
3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6webkitIndexedDB.open('name')
7db = event.target.result
8db.setVersion('new version')
9setVersionSuccess():
10trans = event.target.result
11PASS trans !== null is true
12trans.oncomplete = startTest
13Deleted all object stores.
14store = db.createObjectStore('storeName', null)
15store.add({x: 'value', y: 'zzz'}, 'key')
16trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
17trans.onabort = transactionAborted
18trans.oncomplete = unexpectedCompleteCallback
19store = trans.objectStore('storeName')
20store.add({x: 'value2', y: 'zzz2'}, 'key2')
21store.add({x: 'value3', y: 'zzz3'}, 'key3')
22PASS event.target.errorCode is webkitIDBDatabaseException.ABORT_ERR
23PASS firstError is false
24PASS secondError is false
25PASS abortFired is false
26Expecting exception from store.add({x: 'value4', y: 'zzz4'}, 'key4')
27PASS Exception was thrown.
28PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
29PASS event.target.errorCode is webkitIDBDatabaseException.ABORT_ERR
30PASS firstError is true
31PASS secondError is false
32PASS abortFired is false
33PASS firstError is true
34PASS secondError is true
35PASS abortFired is false
36Expecting exception from store.add({x: 'value5', y: 'zzz5'}, 'key5')
37PASS Exception was thrown.
38PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
39PASS successfullyParsed is true
40
41TEST COMPLETE
42
43