OLD | NEW |
1 Test read-only transactions in IndexedDB. | 1 Test read-only transactions in IndexedDB. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "transaction-read-only.html" | 8 dbname = "transaction-read-only.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 store = db.createObjectStore('store') | 11 store = db.createObjectStore('store') |
12 store.put('x', 'y') | 12 store.put('x', 'y') |
13 trans = db.transaction('store') | 13 trans = db.transaction('store') |
14 Expecting exception from trans.objectStore('store').put('a', 'b') | 14 Expecting exception from trans.objectStore('store').put('a', 'b') |
15 PASS Exception was thrown. | 15 PASS Exception was thrown. |
16 PASS code is 0 | 16 PASS code is 0 |
17 PASS ename is 'ReadOnlyError' | 17 PASS ename is 'ReadOnlyError' |
| 18 Exception message: A write operation was attempted in a read-only transaction. |
18 trans = db.transaction('store') | 19 trans = db.transaction('store') |
19 Expecting exception from trans.objectStore('store').delete('x') | 20 Expecting exception from trans.objectStore('store').delete('x') |
20 PASS Exception was thrown. | 21 PASS Exception was thrown. |
21 PASS code is 0 | 22 PASS code is 0 |
22 PASS ename is 'ReadOnlyError' | 23 PASS ename is 'ReadOnlyError' |
| 24 Exception message: A write operation was attempted in a read-only transaction. |
23 trans = db.transaction('store') | 25 trans = db.transaction('store') |
24 cur = trans.objectStore('store').openCursor() | 26 cur = trans.objectStore('store').openCursor() |
25 PASS !event.target.result is false | 27 PASS !event.target.result is false |
26 Expecting exception from event.target.result.delete() | 28 Expecting exception from event.target.result.delete() |
27 PASS Exception was thrown. | 29 PASS Exception was thrown. |
28 PASS code is 0 | 30 PASS code is 0 |
29 PASS ename is 'ReadOnlyError' | 31 PASS ename is 'ReadOnlyError' |
| 32 Exception message: A write operation was attempted in a read-only transaction. |
30 PASS successfullyParsed is true | 33 PASS successfullyParsed is true |
31 | 34 |
32 TEST COMPLETE | 35 TEST COMPLETE |
33 | 36 |
OLD | NEW |