1 Test IndexedDB's objectStore.openKeyCursor + the cursor it produces in depth.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "objectstore-keycursor.html"
7 indexedDB.deleteDatabase(dbname)
9 objectStore = db.createObjectStore('someObjectStore')
11 Verify that specifying an invalid direction raises an exception:
12 Expecting TypeError exception from objectStore.openKeyCursor(0, 'invalid-direction')
13 PASS Exception was thrown.
14 PASS objectStore.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The provided value 'invalid-direction' is not a valid enum value of type IDBCursorDirection.
16 objectStore.add('', testData[nextToAdd])
17 objectStore.add('', testData[nextToAdd])
18 objectStore.add('', testData[nextToAdd])
19 objectStore.add('', testData[nextToAdd])
20 objectStore.add('', testData[nextToAdd])
21 objectStore.add('', testData[nextToAdd])
25 Next test: lower open bound is 0; sorted ascending.
26 PASS event.target.result.key is testData[1]
27 PASS event.target.result.key is testData[2]
28 PASS event.target.result.key is testData[3]
29 PASS event.target.result.key is testData[4]
30 PASS event.target.result.key is testData[5]
31 PASS event.target.result is null
33 Next test: lower bound is 0; sorted ascending.
34 PASS event.target.result.key is testData[0]
35 PASS event.target.result.key is testData[1]
36 PASS event.target.result.key is testData[2]
37 PASS event.target.result.key is testData[3]
38 PASS event.target.result.key is testData[4]
39 PASS event.target.result.key is testData[5]
40 PASS event.target.result is null
42 Next test: upper open bound is 0; sorted ascending.
43 PASS event.target.result is null
45 Next test: upper bound is 0; sorted ascending.
46 PASS event.target.result.key is testData[0]
47 PASS event.target.result is null
49 Next test: lower open bound is 0; sorted descending.
50 PASS event.target.result.key is testData[5]
51 PASS event.target.result.key is testData[4]
52 PASS event.target.result.key is testData[3]
53 PASS event.target.result.key is testData[2]
54 PASS event.target.result.key is testData[1]
55 PASS event.target.result is null
57 Next test: lower bound is 0; sorted descending.
58 PASS event.target.result.key is testData[5]
59 PASS event.target.result.key is testData[4]
60 PASS event.target.result.key is testData[3]
61 PASS event.target.result.key is testData[2]
62 PASS event.target.result.key is testData[1]
63 PASS event.target.result.key is testData[0]
64 PASS event.target.result is null
66 Next test: upper open bound is 0; sorted descending.
67 PASS event.target.result is null
69 Next test: upper bound is 0; sorted descending.
70 PASS event.target.result.key is testData[0]
71 PASS event.target.result is null
73 Next test: lower open bound is 1; sorted ascending.
74 PASS event.target.result.key is testData[2]
75 PASS event.target.result.key is testData[3]
76 PASS event.target.result.key is testData[4]
77 PASS event.target.result.key is testData[5]
78 PASS event.target.result is null
80 Next test: lower bound is 1; sorted ascending.
81 PASS event.target.result.key is testData[1]
82 PASS event.target.result.key is testData[2]
83 PASS event.target.result.key is testData[3]
84 PASS event.target.result.key is testData[4]
85 PASS event.target.result.key is testData[5]
86 PASS event.target.result is null
88 Next test: upper open bound is 1; sorted ascending.
89 PASS event.target.result.key is testData[0]
90 PASS event.target.result is null
92 Next test: upper bound is 1; sorted ascending.
93 PASS event.target.result.key is testData[0]
94 PASS event.target.result.key is testData[1]
95 PASS event.target.result is null
97 Next test: lower open bound is 1; sorted descending.
98 PASS event.target.result.key is testData[5]
99 PASS event.target.result.key is testData[4]
100 PASS event.target.result.key is testData[3]
101 PASS event.target.result.key is testData[2]
102 PASS event.target.result is null
104 Next test: lower bound is 1; sorted descending.
105 PASS event.target.result.key is testData[5]
106 PASS event.target.result.key is testData[4]
107 PASS event.target.result.key is testData[3]
108 PASS event.target.result.key is testData[2]
109 PASS event.target.result.key is testData[1]
110 PASS event.target.result is null
112 Next test: upper open bound is 1; sorted descending.
113 PASS event.target.result.key is testData[0]
114 PASS event.target.result is null
116 Next test: upper bound is 1; sorted descending.
117 PASS event.target.result.key is testData[1]
118 PASS event.target.result.key is testData[0]
119 PASS event.target.result is null
121 Next test: lower open bound is 2; sorted ascending.
122 PASS event.target.result.key is testData[3]
123 PASS event.target.result.key is testData[4]
124 PASS event.target.result.key is testData[5]
125 PASS event.target.result is null
127 Next test: lower bound is 2; sorted ascending.
128 PASS event.target.result.key is testData[2]
129 PASS event.target.result.key is testData[3]
130 PASS event.target.result.key is testData[4]
131 PASS event.target.result.key is testData[5]
132 PASS event.target.result is null
134 Next test: upper open bound is 2; sorted ascending.
135 PASS event.target.result.key is testData[0]
136 PASS event.target.result.key is testData[1]
137 PASS event.target.result is null
139 Next test: upper bound is 2; sorted ascending.
140 PASS event.target.result.key is testData[0]
141 PASS event.target.result.key is testData[1]
142 PASS event.target.result.key is testData[2]
143 PASS event.target.result is null
145 Next test: lower open bound is 2; sorted descending.
146 PASS event.target.result.key is testData[5]
147 PASS event.target.result.key is testData[4]
148 PASS event.target.result.key is testData[3]
149 PASS event.target.result is null
151 Next test: lower bound is 2; sorted descending.
152 PASS event.target.result.key is testData[5]
153 PASS event.target.result.key is testData[4]
154 PASS event.target.result.key is testData[3]
155 PASS event.target.result.key is testData[2]
156 PASS event.target.result is null
158 Next test: upper open bound is 2; sorted descending.
159 PASS event.target.result.key is testData[1]
160 PASS event.target.result.key is testData[0]
161 PASS event.target.result is null
163 Next test: upper bound is 2; sorted descending.
164 PASS event.target.result.key is testData[2]
165 PASS event.target.result.key is testData[1]
166 PASS event.target.result.key is testData[0]
167 PASS event.target.result is null
169 Next test: lower open bound is 3; sorted ascending.
170 PASS event.target.result.key is testData[4]
171 PASS event.target.result.key is testData[5]
172 PASS event.target.result is null
174 Next test: lower bound is 3; sorted ascending.
175 PASS event.target.result.key is testData[3]
176 PASS event.target.result.key is testData[4]
177 PASS event.target.result.key is testData[5]
178 PASS event.target.result is null
180 Next test: upper open bound is 3; sorted ascending.
181 PASS event.target.result.key is testData[0]
182 PASS event.target.result.key is testData[1]
183 PASS event.target.result.key is testData[2]
184 PASS event.target.result is null
186 Next test: upper bound is 3; sorted ascending.
187 PASS event.target.result.key is testData[0]
188 PASS event.target.result.key is testData[1]
189 PASS event.target.result.key is testData[2]
190 PASS event.target.result.key is testData[3]
191 PASS event.target.result is null
193 Next test: lower open bound is 3; sorted descending.
194 PASS event.target.result.key is testData[5]
195 PASS event.target.result.key is testData[4]
196 PASS event.target.result is null
198 Next test: lower bound is 3; sorted descending.
199 PASS event.target.result.key is testData[5]
200 PASS event.target.result.key is testData[4]
201 PASS event.target.result.key is testData[3]
202 PASS event.target.result is null
204 Next test: upper open bound is 3; sorted descending.
205 PASS event.target.result.key is testData[2]
206 PASS event.target.result.key is testData[1]
207 PASS event.target.result.key is testData[0]
208 PASS event.target.result is null
210 Next test: upper bound is 3; sorted descending.
211 PASS event.target.result.key is testData[3]
212 PASS event.target.result.key is testData[2]
213 PASS event.target.result.key is testData[1]
214 PASS event.target.result.key is testData[0]
215 PASS event.target.result is null
217 Next test: lower open bound is 4; sorted ascending.
218 PASS event.target.result.key is testData[5]
219 PASS event.target.result is null
221 Next test: lower bound is 4; sorted ascending.
222 PASS event.target.result.key is testData[4]
223 PASS event.target.result.key is testData[5]
224 PASS event.target.result is null
226 Next test: upper open bound is 4; sorted ascending.
227 PASS event.target.result.key is testData[0]
228 PASS event.target.result.key is testData[1]
229 PASS event.target.result.key is testData[2]
230 PASS event.target.result.key is testData[3]
231 PASS event.target.result is null
233 Next test: upper bound is 4; sorted ascending.
234 PASS event.target.result.key is testData[0]
235 PASS event.target.result.key is testData[1]
236 PASS event.target.result.key is testData[2]
237 PASS event.target.result.key is testData[3]
238 PASS event.target.result.key is testData[4]
239 PASS event.target.result is null
241 Next test: lower open bound is 4; sorted descending.
242 PASS event.target.result.key is testData[5]
243 PASS event.target.result is null
245 Next test: lower bound is 4; sorted descending.
246 PASS event.target.result.key is testData[5]
247 PASS event.target.result.key is testData[4]
248 PASS event.target.result is null
250 Next test: upper open bound is 4; sorted descending.
251 PASS event.target.result.key is testData[3]
252 PASS event.target.result.key is testData[2]
253 PASS event.target.result.key is testData[1]
254 PASS event.target.result.key is testData[0]
255 PASS event.target.result is null
257 Next test: upper bound is 4; sorted descending.
258 PASS event.target.result.key is testData[4]
259 PASS event.target.result.key is testData[3]
260 PASS event.target.result.key is testData[2]
261 PASS event.target.result.key is testData[1]
262 PASS event.target.result.key is testData[0]
263 PASS event.target.result is null
265 Next test: lower open bound is 5; sorted ascending.
266 PASS event.target.result is null
268 Next test: lower bound is 5; sorted ascending.
269 PASS event.target.result.key is testData[5]
270 PASS event.target.result is null
272 Next test: upper open bound is 5; sorted ascending.
273 PASS event.target.result.key is testData[0]
274 PASS event.target.result.key is testData[1]
275 PASS event.target.result.key is testData[2]
276 PASS event.target.result.key is testData[3]
277 PASS event.target.result.key is testData[4]
278 PASS event.target.result is null
280 Next test: upper bound is 5; sorted ascending.
281 PASS event.target.result.key is testData[0]
282 PASS event.target.result.key is testData[1]
283 PASS event.target.result.key is testData[2]
284 PASS event.target.result.key is testData[3]
285 PASS event.target.result.key is testData[4]
286 PASS event.target.result.key is testData[5]
287 PASS event.target.result is null
289 Next test: lower open bound is 5; sorted descending.
290 PASS event.target.result is null
292 Next test: lower bound is 5; sorted descending.
293 PASS event.target.result.key is testData[5]
294 PASS event.target.result is null
296 Next test: upper open bound is 5; sorted descending.
297 PASS event.target.result.key is testData[4]
298 PASS event.target.result.key is testData[3]
299 PASS event.target.result.key is testData[2]
300 PASS event.target.result.key is testData[1]
301 PASS event.target.result.key is testData[0]
302 PASS event.target.result is null
304 Next test: upper bound is 5; sorted descending.
305 PASS event.target.result.key is testData[5]
306 PASS event.target.result.key is testData[4]
307 PASS event.target.result.key is testData[3]
308 PASS event.target.result.key is testData[2]
309 PASS event.target.result.key is testData[1]
310 PASS event.target.result.key is testData[0]
311 PASS event.target.result is null
313 Next test: null key path sorted ascending.
314 PASS event.target.result.key is testData[0]
315 PASS event.target.result.key is testData[1]
316 PASS event.target.result.key is testData[2]
317 PASS event.target.result.key is testData[3]
318 PASS event.target.result.key is testData[4]
319 PASS event.target.result.key is testData[5]
320 PASS event.target.result is null
322 Next test: null key path sorted descending.
323 PASS event.target.result.key is testData[5]
324 PASS event.target.result.key is testData[4]
325 PASS event.target.result.key is testData[3]
326 PASS event.target.result.key is testData[2]
327 PASS event.target.result.key is testData[1]
328 PASS event.target.result.key is testData[0]
329 PASS event.target.result is null
330 PASS successfullyParsed is true