1 Test IndexedDB's openCursor.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "open-cursor.html"
7 indexedDB.deleteDatabase(dbname)
9 objectStore = db.createObjectStore('test')
10 objectStore.add('myValue', 'myKey')
12 event.target.source.openCursor(keyRange)
13 Cursor opened successfully.
14 PASS cursor.direction is "next"
15 PASS cursor.key is "myKey"
16 PASS cursor.value is "myValue"
18 Passing an invalid key into .continue({}).
19 Expecting exception from event.target.result.continue({})
20 PASS Exception was thrown.
22 PASS ename is 'DataError'
23 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is not a valid key.
25 Opening an empty cursor.
26 objectStore.openCursor(keyRange)
27 Empty cursor opened successfully.
30 event.target.source.openCursor("myKey")
31 Cursor opened successfully.
32 PASS cursor.direction is "next"
33 PASS cursor.key is "myKey"
34 PASS cursor.value is "myValue"
36 Passing an invalid key into .continue({}).
37 Expecting exception from cursor.continue({})
38 PASS Exception was thrown.
40 PASS ename is 'DataError'
41 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is not a valid key.
43 Opening an empty cursor.
44 objectStore.openCursor("InexistentKey")
45 Empty cursor opened successfully.
47 PASS successfullyParsed is true