1 Test that an aborted 'versionchange' transaction closes the connection.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "aborted-versionchange-closes.html"
7 indexedDB.deleteDatabase(dbname)
8 indexedDB.open(dbname, 1)
11 db = event.target.result
12 db.createObjectStore('store')
15 db = event.target.result
19 request = indexedDB.open(dbname, 2)
22 db = event.target.result
23 transaction = event.target.transaction
24 sawTransactionAbort = false
27 sawTransactionAbort = true
28 creating a transaction should fail because connection is closed:
29 Expecting exception from db.transaction('store')
30 PASS Exception was thrown.
31 PASS code is DOMException.INVALID_STATE_ERR
32 PASS ename is 'InvalidStateError'
33 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
36 PASS sawTransactionAbort is true
37 creating a transaction should fail because connection is closed:
38 Expecting exception from db.transaction('store')
39 PASS Exception was thrown.
40 PASS code is DOMException.INVALID_STATE_ERR
41 PASS ename is 'InvalidStateError'
42 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
43 PASS successfullyParsed is true