OLD | NEW |
1 Test IndexedDB's readonly transactions | 1 Test IndexedDB's readonly transactions |
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 = "readonly-transactions.html" | 8 dbname = "readonly-transactions.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 objectStore = db.createObjectStore(osName, { autoIncrement: true }); | 11 objectStore = db.createObjectStore(osName, { autoIncrement: true }); |
12 Expecting exception from db.transaction([osName]).objectStore(osName).add({}); | 12 Expecting exception from db.transaction([osName]).objectStore(osName).add({}); |
13 PASS Exception was thrown. | 13 PASS Exception was thrown. |
14 PASS code is 0 | 14 PASS code is 0 |
15 PASS ename is 'ReadOnlyError' | 15 PASS ename is 'ReadOnlyError' |
| 16 Exception message: A write operation was attempted in a read-only transaction. |
16 Expecting exception from db.transaction(osName).objectStore(osName).add({}); | 17 Expecting exception from db.transaction(osName).objectStore(osName).add({}); |
17 PASS Exception was thrown. | 18 PASS Exception was thrown. |
18 PASS code is 0 | 19 PASS code is 0 |
19 PASS ename is 'ReadOnlyError' | 20 PASS ename is 'ReadOnlyError' |
| 21 Exception message: A write operation was attempted in a read-only transaction. |
20 key1 = 1; | 22 key1 = 1; |
21 key2 = 2; | 23 key2 = 2; |
22 Expecting exception from db.transaction([osName]).objectStore(osName).put({}, ke
y1); | 24 Expecting exception from db.transaction([osName]).objectStore(osName).put({}, ke
y1); |
23 PASS Exception was thrown. | 25 PASS Exception was thrown. |
24 PASS code is 0 | 26 PASS code is 0 |
25 PASS ename is 'ReadOnlyError' | 27 PASS ename is 'ReadOnlyError' |
| 28 Exception message: A write operation was attempted in a read-only transaction. |
26 Expecting exception from db.transaction(osName).objectStore(osName).put({}, key2
); | 29 Expecting exception from db.transaction(osName).objectStore(osName).put({}, key2
); |
27 PASS Exception was thrown. | 30 PASS Exception was thrown. |
28 PASS code is 0 | 31 PASS code is 0 |
29 PASS ename is 'ReadOnlyError' | 32 PASS ename is 'ReadOnlyError' |
| 33 Exception message: A write operation was attempted in a read-only transaction. |
30 Expecting exception from db.transaction([osName]).objectStore(osName).put({}, ke
y1); | 34 Expecting exception from db.transaction([osName]).objectStore(osName).put({}, ke
y1); |
31 PASS Exception was thrown. | 35 PASS Exception was thrown. |
32 PASS code is 0 | 36 PASS code is 0 |
33 PASS ename is 'ReadOnlyError' | 37 PASS ename is 'ReadOnlyError' |
| 38 Exception message: A write operation was attempted in a read-only transaction. |
34 Expecting exception from db.transaction(osName).objectStore(osName).put({}, key1
); | 39 Expecting exception from db.transaction(osName).objectStore(osName).put({}, key1
); |
35 PASS Exception was thrown. | 40 PASS Exception was thrown. |
36 PASS code is 0 | 41 PASS code is 0 |
37 PASS ename is 'ReadOnlyError' | 42 PASS ename is 'ReadOnlyError' |
| 43 Exception message: A write operation was attempted in a read-only transaction. |
38 Expecting exception from db.transaction([osName]).objectStore(osName).delete(key
1); | 44 Expecting exception from db.transaction([osName]).objectStore(osName).delete(key
1); |
39 PASS Exception was thrown. | 45 PASS Exception was thrown. |
40 PASS code is 0 | 46 PASS code is 0 |
41 PASS ename is 'ReadOnlyError' | 47 PASS ename is 'ReadOnlyError' |
| 48 Exception message: A write operation was attempted in a read-only transaction. |
42 Expecting exception from db.transaction(osName).objectStore(osName).delete(key2)
; | 49 Expecting exception from db.transaction(osName).objectStore(osName).delete(key2)
; |
43 PASS Exception was thrown. | 50 PASS Exception was thrown. |
44 PASS code is 0 | 51 PASS code is 0 |
45 PASS ename is 'ReadOnlyError' | 52 PASS ename is 'ReadOnlyError' |
| 53 Exception message: A write operation was attempted in a read-only transaction. |
46 PASS successfullyParsed is true | 54 PASS successfullyParsed is true |
47 | 55 |
48 TEST COMPLETE | 56 TEST COMPLETE |
49 | 57 |
OLD | NEW |