1 Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor().
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "cursor-overloads.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('store')
10 index = store.createIndex('index', 'value')
11 store.put({value: 0}, 0)
14 trans = db.transaction('store')
15 store = trans.objectStore('store')
16 index = store.index('index')
18 PASS event.target.result is non-null.
19 PASS event.target.result.direction is "next"
21 PASS event.target.result is non-null.
22 PASS event.target.result.direction is "next"
23 store.openCursor(0, 'next')
24 PASS event.target.result is non-null.
25 PASS event.target.result.direction is "next"
26 store.openCursor(0, 'nextunique')
27 PASS event.target.result is non-null.
28 PASS event.target.result.direction is "nextunique"
29 store.openCursor(0, 'prev')
30 PASS event.target.result is non-null.
31 PASS event.target.result.direction is "prev"
32 store.openCursor(0, 'prevunique')
33 PASS event.target.result is non-null.
34 PASS event.target.result.direction is "prevunique"
35 store.openCursor(IDBKeyRange.only(0))
36 PASS event.target.result is non-null.
37 PASS event.target.result.direction is "next"
38 store.openCursor(IDBKeyRange.only(0), 'next')
39 PASS event.target.result is non-null.
40 PASS event.target.result.direction is "next"
41 store.openCursor(IDBKeyRange.only(0), 'nextunique')
42 PASS event.target.result is non-null.
43 PASS event.target.result.direction is "nextunique"
44 store.openCursor(IDBKeyRange.only(0), 'prev')
45 PASS event.target.result is non-null.
46 PASS event.target.result.direction is "prev"
47 store.openCursor(IDBKeyRange.only(0), 'prevunique')
48 PASS event.target.result is non-null.
49 PASS event.target.result.direction is "prevunique"
51 PASS event.target.result is non-null.
52 PASS event.target.result.direction is "next"
53 store.openKeyCursor(0)
54 PASS event.target.result is non-null.
55 PASS event.target.result.direction is "next"
56 store.openKeyCursor(0, 'next')
57 PASS event.target.result is non-null.
58 PASS event.target.result.direction is "next"
59 store.openKeyCursor(0, 'nextunique')
60 PASS event.target.result is non-null.
61 PASS event.target.result.direction is "nextunique"
62 store.openKeyCursor(0, 'prev')
63 PASS event.target.result is non-null.
64 PASS event.target.result.direction is "prev"
65 store.openKeyCursor(0, 'prevunique')
66 PASS event.target.result is non-null.
67 PASS event.target.result.direction is "prevunique"
68 store.openKeyCursor(IDBKeyRange.only(0))
69 PASS event.target.result is non-null.
70 PASS event.target.result.direction is "next"
71 store.openKeyCursor(IDBKeyRange.only(0), 'next')
72 PASS event.target.result is non-null.
73 PASS event.target.result.direction is "next"
74 store.openKeyCursor(IDBKeyRange.only(0), 'nextunique')
75 PASS event.target.result is non-null.
76 PASS event.target.result.direction is "nextunique"
77 store.openKeyCursor(IDBKeyRange.only(0), 'prev')
78 PASS event.target.result is non-null.
79 PASS event.target.result.direction is "prev"
80 store.openKeyCursor(IDBKeyRange.only(0), 'prevunique')
81 PASS event.target.result is non-null.
82 PASS event.target.result.direction is "prevunique"
84 PASS event.target.result is non-null.
85 PASS event.target.result.direction is "next"
87 PASS event.target.result is non-null.
88 PASS event.target.result.direction is "next"
89 index.openCursor(0, 'next')
90 PASS event.target.result is non-null.
91 PASS event.target.result.direction is "next"
92 index.openCursor(0, 'nextunique')
93 PASS event.target.result is non-null.
94 PASS event.target.result.direction is "nextunique"
95 index.openCursor(0, 'prev')
96 PASS event.target.result is non-null.
97 PASS event.target.result.direction is "prev"
98 index.openCursor(0, 'prevunique')
99 PASS event.target.result is non-null.
100 PASS event.target.result.direction is "prevunique"
101 index.openCursor(IDBKeyRange.only(0))
102 PASS event.target.result is non-null.
103 PASS event.target.result.direction is "next"
104 index.openCursor(IDBKeyRange.only(0), 'next')
105 PASS event.target.result is non-null.
106 PASS event.target.result.direction is "next"
107 index.openCursor(IDBKeyRange.only(0), 'nextunique')
108 PASS event.target.result is non-null.
109 PASS event.target.result.direction is "nextunique"
110 index.openCursor(IDBKeyRange.only(0), 'prev')
111 PASS event.target.result is non-null.
112 PASS event.target.result.direction is "prev"
113 index.openCursor(IDBKeyRange.only(0), 'prevunique')
114 PASS event.target.result is non-null.
115 PASS event.target.result.direction is "prevunique"
116 index.openKeyCursor()
117 PASS event.target.result is non-null.
118 PASS event.target.result.direction is "next"
119 index.openKeyCursor(0)
120 PASS event.target.result is non-null.
121 PASS event.target.result.direction is "next"
122 index.openKeyCursor(0, 'next')
123 PASS event.target.result is non-null.
124 PASS event.target.result.direction is "next"
125 index.openKeyCursor(0, 'nextunique')
126 PASS event.target.result is non-null.
127 PASS event.target.result.direction is "nextunique"
128 index.openKeyCursor(0, 'prev')
129 PASS event.target.result is non-null.
130 PASS event.target.result.direction is "prev"
131 index.openKeyCursor(0, 'prevunique')
132 PASS event.target.result is non-null.
133 PASS event.target.result.direction is "prevunique"
134 index.openKeyCursor(IDBKeyRange.only(0))
135 PASS event.target.result is non-null.
136 PASS event.target.result.direction is "next"
137 index.openKeyCursor(IDBKeyRange.only(0), 'next')
138 PASS event.target.result is non-null.
139 PASS event.target.result.direction is "next"
140 index.openKeyCursor(IDBKeyRange.only(0), 'nextunique')
141 PASS event.target.result is non-null.
142 PASS event.target.result.direction is "nextunique"
143 index.openKeyCursor(IDBKeyRange.only(0), 'prev')
144 PASS event.target.result is non-null.
145 PASS event.target.result.direction is "prev"
146 index.openKeyCursor(IDBKeyRange.only(0), 'prevunique')
147 PASS event.target.result is non-null.
148 PASS event.target.result.direction is "prevunique"
149 PASS successfullyParsed is true