Home | History | Annotate | Download | only in indexeddb
      1 Test closing a database connection in IndexedDB.
      2 
      3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
      4 
      5 
      6 PASS 'webkitIndexedDB' in window is true
      7 PASS webkitIndexedDB == null is false
      8 webkitIndexedDB.open('transaction-after-close')
      9 openSuccess():
     10 db = event.target.result
     11 request = db.setVersion('version 1')
     12 Deleted all object stores.
     13 store = db.createObjectStore('store')
     14 request = store.put('x', 'y')
     15 PASS Put success
     16 running first transaction
     17 currentTransaction = db.transaction([], webkitIDBTransaction.READ_WRITE)
     18 objectStore.put('a', 'b')
     19 db.close()
     20 Expecting exception from db.transaction([], webkitIDBTransaction.READ_WRITE)
     21 PASS Exception was thrown.
     22 PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
     23 
     24 verify that we can reopen the db after calling close
     25 webkitIndexedDB.open('transaction-after-close')
     26 second_db = event.target.result
     27 currentTransaction = second_db.transaction([], webkitIDBTransaction.READ_WRITE)
     28 request = store.put('1', '2')
     29 PASS final put success
     30 PASS successfullyParsed is true
     31 
     32 TEST COMPLETE
     33 
     34