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