OLD | NEW |
1 Test IndexedDB's openCursor. | 1 Test IndexedDB's openCursor. |
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 = "open-cursor.html" | 8 dbname = "open-cursor.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 objectStore = db.createObjectStore('test') | 11 objectStore = db.createObjectStore('test') |
12 objectStore.add('myValue', 'myKey') | 12 objectStore.add('myValue', 'myKey') |
13 Opening cursor | 13 Opening cursor |
14 event.target.source.openCursor(keyRange) | 14 event.target.source.openCursor(keyRange) |
15 Cursor opened successfully. | 15 Cursor opened successfully. |
16 PASS cursor.direction is "next" | 16 PASS cursor.direction is "next" |
17 PASS cursor.key is "myKey" | 17 PASS cursor.key is "myKey" |
18 PASS cursor.value is "myValue" | 18 PASS cursor.value is "myValue" |
19 | 19 |
20 Passing an invalid key into .continue({}). | 20 Passing an invalid key into .continue({}). |
21 Expecting exception from event.target.result.continue({}) | 21 Expecting exception from event.target.result.continue({}) |
22 PASS Exception was thrown. | 22 PASS Exception was thrown. |
23 PASS code is 0 | 23 PASS code is 0 |
24 PASS ename is 'DataError' | 24 PASS ename is 'DataError' |
| 25 Exception message: The parameter is not a valid key. |
25 | 26 |
26 Opening an empty cursor. | 27 Opening an empty cursor. |
27 objectStore.openCursor(keyRange) | 28 objectStore.openCursor(keyRange) |
28 Empty cursor opened successfully. | 29 Empty cursor opened successfully. |
29 PASS cursor is null | 30 PASS cursor is null |
30 Opening cursor | 31 Opening cursor |
31 event.target.source.openCursor("myKey") | 32 event.target.source.openCursor("myKey") |
32 Cursor opened successfully. | 33 Cursor opened successfully. |
33 PASS cursor.direction is "next" | 34 PASS cursor.direction is "next" |
34 PASS cursor.key is "myKey" | 35 PASS cursor.key is "myKey" |
35 PASS cursor.value is "myValue" | 36 PASS cursor.value is "myValue" |
36 | 37 |
37 Passing an invalid key into .continue({}). | 38 Passing an invalid key into .continue({}). |
38 Expecting exception from cursor.continue({}) | 39 Expecting exception from cursor.continue({}) |
39 PASS Exception was thrown. | 40 PASS Exception was thrown. |
40 PASS code is 0 | 41 PASS code is 0 |
41 PASS ename is 'DataError' | 42 PASS ename is 'DataError' |
| 43 Exception message: The parameter is not a valid key. |
42 | 44 |
43 Opening an empty cursor. | 45 Opening an empty cursor. |
44 objectStore.openCursor("InexistentKey") | 46 objectStore.openCursor("InexistentKey") |
45 Empty cursor opened successfully. | 47 Empty cursor opened successfully. |
46 PASS cursor is null | 48 PASS cursor is null |
47 PASS successfullyParsed is true | 49 PASS successfullyParsed is true |
48 | 50 |
49 TEST COMPLETE | 51 TEST COMPLETE |
50 | 52 |
OLD | NEW |