1 Ensure cursor calls behave as expected after cursor has run to the end.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-finished.html"
9 indexedDB.deleteDatabase(dbname)
12 indexedDB.open(dbname, 1)
15 db = event.target.result
16 store = db.createObjectStore('store')
21 db = event.target.result
22 transaction = db.transaction('store', 'readwrite')
23 store = transaction.objectStore('store')
25 cursorRequest = store.openCursor()
28 cursor = event.target.result
29 PASS cursor is non-null.
35 cursor = event.target.result
36 PASS cursor is non-null.
42 cursor = event.target.result
44 PASS savedCursor is non-null.
46 Expecting exception from savedCursor.update('value')
47 PASS Exception was thrown.
48 PASS code is DOMException.INVALID_STATE_ERR
49 PASS ename is 'InvalidStateError'
50 Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
51 Expecting exception from savedCursor.advance(1)
52 PASS Exception was thrown.
53 PASS code is DOMException.INVALID_STATE_ERR
54 PASS ename is 'InvalidStateError'
55 Exception message: Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
56 Expecting exception from savedCursor.continue()
57 PASS Exception was thrown.
58 PASS code is DOMException.INVALID_STATE_ERR
59 PASS ename is 'InvalidStateError'
60 Exception message: Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
61 Expecting exception from savedCursor.continue('key')
62 PASS Exception was thrown.
63 PASS code is DOMException.INVALID_STATE_ERR
64 PASS ename is 'InvalidStateError'
65 Exception message: Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
66 Expecting exception from savedCursor.delete()
67 PASS Exception was thrown.
68 PASS code is DOMException.INVALID_STATE_ERR
69 PASS ename is 'InvalidStateError'
70 Exception message: Failed to execute 'delete' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
72 PASS successfullyParsed is true