1 Test read-only transactions in IndexedDB.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "transaction-read-only.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('store')
11 trans = db.transaction('store')
12 Expecting exception from trans.objectStore('store').put('a', 'b')
13 PASS Exception was thrown.
15 PASS ename is 'ReadOnlyError'
16 Exception message: Failed to execute 'put' on 'IDBObjectStore': The transaction is read-only.
17 trans = db.transaction('store')
18 Expecting exception from trans.objectStore('store').delete('x')
19 PASS Exception was thrown.
21 PASS ename is 'ReadOnlyError'
22 Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.
23 trans = db.transaction('store')
24 cur = trans.objectStore('store').openCursor()
25 PASS !event.target.result is false
26 Expecting exception from event.target.result.delete()
27 PASS Exception was thrown.
29 PASS ename is 'ReadOnlyError'
30 Exception message: Failed to execute 'delete' on 'IDBCursor': The record may not be deleted inside a read-only transaction.
31 PASS successfullyParsed is true