1 Test closing a database connection in IndexedDB.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "transaction-after-close.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('store')
10 request = store.put('x', 'y')
12 running first transaction
13 currentTransaction = db.transaction(['store'], 'readwrite')
14 objectStore.put('a', 'b')
16 Expecting exception from db.transaction(['store'], 'readwrite')
17 PASS Exception was thrown.
18 PASS code is DOMException.INVALID_STATE_ERR
19 PASS ename is 'InvalidStateError'
20 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
22 verify that we can reopen the db after calling close
23 indexedDB.open(dbname)
24 second_db = event.target.result
25 currentTransaction = second_db.transaction(['store'], 'readwrite')
26 request = store.put('1', '2')
27 PASS final put success
28 PASS successfullyParsed is true