1 Test the basics of IndexedDB's IDBCursor objects.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-basics.html"
7 indexedDB.deleteDatabase(dbname)
11 store = db.createObjectStore('storeName')
12 index = store.createIndex('indexName', 'indexOn')
13 store.put({indexOn: 'a'}, 0)
20 cursor = event.target.result
21 PASS cursor is non-null.
22 PASS cursor instanceof IDBCursor is true
23 PASS 'key' in cursor is true
24 PASS 'primaryKey' in cursor is true
25 PASS 'continue' in cursor is true
26 PASS typeof cursor.continue is "function"
27 PASS 'continuePrimaryKey' in cursor is true
28 PASS typeof cursor.continuePrimaryKey is "function"
29 PASS 'advance' in cursor is true
30 PASS typeof cursor.advance is "function"
31 PASS 'update' in cursor is true
32 PASS typeof cursor.update is "function"
33 PASS 'delete' in cursor is true
34 PASS typeof cursor.delete is "function"
36 PASS cursor.primaryKey is 0
37 PASS cursor instanceof IDBCursorWithValue is true
38 PASS 'value' in cursor is true
39 PASS JSON.stringify(cursor.value) is "{\"indexOn\":\"a\"}"
41 onStoreOpenKeyCursor():
42 cursor = event.target.result
43 PASS cursor is non-null.
44 PASS cursor instanceof IDBCursor is true
45 PASS 'key' in cursor is true
46 PASS 'primaryKey' in cursor is true
47 PASS 'continue' in cursor is true
48 PASS typeof cursor.continue is "function"
49 PASS 'continuePrimaryKey' in cursor is true
50 PASS typeof cursor.continuePrimaryKey is "function"
51 PASS 'advance' in cursor is true
52 PASS typeof cursor.advance is "function"
53 PASS 'update' in cursor is true
54 PASS typeof cursor.update is "function"
55 PASS 'delete' in cursor is true
56 PASS typeof cursor.delete is "function"
58 PASS 'primaryKey' in cursor is true
59 PASS cursor.primaryKey is 0
60 PASS cursor instanceof IDBCursorWithValue is false
61 PASS 'value' in cursor is false
64 cursor = event.target.result
65 PASS cursor is non-null.
66 PASS cursor instanceof IDBCursor is true
67 PASS 'key' in cursor is true
68 PASS 'primaryKey' in cursor is true
69 PASS 'continue' in cursor is true
70 PASS typeof cursor.continue is "function"
71 PASS 'continuePrimaryKey' in cursor is true
72 PASS typeof cursor.continuePrimaryKey is "function"
73 PASS 'advance' in cursor is true
74 PASS typeof cursor.advance is "function"
75 PASS 'update' in cursor is true
76 PASS typeof cursor.update is "function"
77 PASS 'delete' in cursor is true
78 PASS typeof cursor.delete is "function"
79 PASS cursor.key is "a"
80 PASS cursor.primaryKey is 0
81 PASS cursor instanceof IDBCursorWithValue is true
82 PASS 'value' in cursor is true
83 PASS JSON.stringify(cursor.value) is "{\"indexOn\":\"a\"}"
85 onIndexOpenKeyCursor():
86 cursor = event.target.result
87 PASS cursor is non-null.
88 PASS cursor instanceof IDBCursor is true
89 PASS 'key' in cursor is true
90 PASS 'primaryKey' in cursor is true
91 PASS 'continue' in cursor is true
92 PASS typeof cursor.continue is "function"
93 PASS 'continuePrimaryKey' in cursor is true
94 PASS typeof cursor.continuePrimaryKey is "function"
95 PASS 'advance' in cursor is true
96 PASS typeof cursor.advance is "function"
97 PASS 'update' in cursor is true
98 PASS typeof cursor.update is "function"
99 PASS 'delete' in cursor is true
100 PASS typeof cursor.delete is "function"
101 PASS cursor.key is "a"
102 PASS cursor.primaryKey is 0
103 PASS cursor instanceof IDBCursorWithValue is false
104 PASS cursor.primaryKey is 0
105 PASS 'value' in cursor is false
106 PASS successfullyParsed is true