1 Test that expected exceptions are thrown per IndexedDB spec.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "exceptions.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('store')
10 index = store.createIndex('index', 'id')
11 store.put({id: 'a'}, 1)
12 store.put({id: 'b'}, 2)
13 store.put({id: 'c'}, 3)
14 store.put({id: 'd'}, 4)
15 store.put({id: 'e'}, 5)
16 store.put({id: 'f'}, 6)
17 store.put({id: 'g'}, 7)
18 store.put({id: 'h'}, 8)
19 store.put({id: 'i'}, 9)
20 store.put({id: 'j'}, 10)
21 otherStore = db.createObjectStore('otherStore')
22 inlineKeyStore = db.createObjectStore('inlineKeyStore', {keyPath: 'id'})
23 request = inlineKeyStore.put({id: 0})
24 PASS request.readyState is "pending"
26 3.2.1 The IDBRequest Interface
29 When the done flag is false, getting this property must throw a DOMException of type InvalidStateError.
30 Expecting exception from request.error
31 PASS Exception was thrown.
32 PASS code is DOMException.INVALID_STATE_ERR
33 PASS ename is 'InvalidStateError'
34 Exception message: Failed to read the 'error' property from 'IDBRequest': The request has not finished.
37 When the done flag is false, getting this property must throw a DOMException of type InvalidStateError.
38 Expecting exception from request.result
39 PASS Exception was thrown.
40 PASS code is DOMException.INVALID_STATE_ERR
41 PASS ename is 'InvalidStateError'
42 Exception message: Failed to read the 'result' property from 'IDBRequest': The request has not finished.
44 3.2.3 Opening a database
47 One of the supplied keys was not a valid key.
48 Expecting exception from indexedDB.cmp(null, 0)
49 PASS Exception was thrown.
51 PASS ename is 'DataError'
52 Exception message: Failed to execute 'cmp' on 'IDBFactory': The parameter is not a valid key.
56 indexedDB.open(dbname, 2)
58 IDBDatabase.createObjectStore()
59 If an objectStore with the same name already exists, the implementation must throw a DOMException of type ConstraintError.
60 Expecting exception from db.createObjectStore('store')
61 PASS Exception was thrown.
63 PASS ename is 'ConstraintError'
64 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': An object store with the specified name already exists.
65 If keyPath is not a valid key path then a DOMException of type SyntaxError must be thrown.
66 Expecting exception from db.createObjectStore('fail', {keyPath: '-invalid-'})
67 PASS Exception was thrown.
68 PASS code is DOMException.SYNTAX_ERR
69 PASS ename is 'SyntaxError'
70 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path.
71 If the optionalParameters parameter is specified, and autoIncrement is set to true, and the keyPath parameter is specified to the empty string, or specified to an Array, this function must throw a InvalidAccessError exception.
72 Expecting exception from db.createObjectStore('fail', {autoIncrement: true, keyPath: ''})
73 PASS Exception was thrown.
74 PASS code is DOMException.INVALID_ACCESS_ERR
75 PASS ename is 'InvalidAccessError'
76 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.
77 Expecting exception from db.createObjectStore('fail', {autoIncrement: true, keyPath: ['a']})
78 PASS Exception was thrown.
79 PASS code is DOMException.INVALID_ACCESS_ERR
80 PASS ename is 'InvalidAccessError'
81 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.
83 IDBDatabase.deleteObjectStore()
84 There is no object store with the given name, compared in a case-sensitive manner, in the connected database.
85 Expecting exception from db.deleteObjectStore('no-such-store')
86 PASS Exception was thrown.
87 PASS code is DOMException.NOT_FOUND_ERR
88 PASS ename is 'NotFoundError'
89 Exception message: Failed to execute 'deleteObjectStore' on 'IDBDatabase': The specified object store was not found.
91 IDBDatabase.transaction()
92 If this method is called on IDBDatabase object for which a "versionchange" transaction is still running, a InvalidStateError exception must be thrown.
93 Expecting exception from db.transaction('store')
94 PASS Exception was thrown.
95 PASS code is DOMException.INVALID_STATE_ERR
96 PASS ename is 'InvalidStateError'
97 Exception message: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.
98 One of the names provided in the storeNames argument doesn't exist in this database.
99 Expecting exception from db.transaction('no-such-store')
100 PASS Exception was thrown.
101 PASS code is DOMException.NOT_FOUND_ERR
102 PASS ename is 'NotFoundError'
103 Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
104 The value for the mode parameter is invalid.
105 Expecting TypeError exception from db.transaction('store', 'invalid-mode')
106 PASS Exception was thrown.
107 PASS db.transaction('store', 'invalid-mode') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': The provided value 'invalid-mode' is not a valid enum value of type IDBTransactionMode.
108 The 'versionchange' value for the mode parameter can only be set internally during upgradeneeded.
109 Expecting TypeError exception from db.transaction('store', 'versionchange')
110 PASS Exception was thrown.
111 PASS db.transaction('store', 'versionchange') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': The mode provided ('versionchange') is not one of 'readonly' or 'readwrite'.
112 The function was called with an empty list of store names
113 Expecting exception from db.transaction([])
114 PASS Exception was thrown.
115 PASS code is DOMException.INVALID_ACCESS_ERR
116 PASS ename is 'InvalidAccessError'
117 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The storeNames parameter was empty.
119 One more IDBDatabase.createObjectStore() test:
120 If this function is called from outside a "versionchange" transaction callback ... the implementation must throw a DOMException of type InvalidStateError.
121 Expecting exception from db.createObjectStore('fail')
122 PASS Exception was thrown.
123 PASS code is DOMException.INVALID_STATE_ERR
124 PASS ename is 'InvalidStateError'
125 Exception message: Failed to execute 'createObjectStore' on 'IDBDatabase': The database is not running a version change transaction.
127 One more IDBDatabase.deleteObjectStore() test:
128 If this function is called from outside a "versionchange" transaction callback ... the implementation must throw a DOMException of type InvalidStateError.
129 Expecting exception from db.deleteObjectStore('fail')
130 PASS Exception was thrown.
131 PASS code is DOMException.INVALID_STATE_ERR
132 PASS ename is 'InvalidStateError'
133 Exception message: Failed to execute 'deleteObjectStore' on 'IDBDatabase': The database is not running a version change transaction.
135 Prepare an object store and index from an inactive transaction for later use.
136 finishedTransaction = inactiveTransaction = db.transaction('store')
137 storeFromInactiveTransaction = inactiveTransaction.objectStore('store')
138 indexFromInactiveTransaction = storeFromInactiveTransaction.index('index')
139 request = storeFromInactiveTransaction.openCursor()
140 cursorFromInactiveTransaction = request.result
143 ro_transaction = db.transaction('store', 'readonly')
144 storeFromReadOnlyTransaction = ro_transaction.objectStore('store')
145 rw_transaction = db.transaction('store', 'readwrite')
146 store = rw_transaction.objectStore('store')
149 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
150 Expecting exception from storeFromReadOnlyTransaction.add(0, 0)
151 PASS Exception was thrown.
153 PASS ename is 'ReadOnlyError'
154 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction is read-only.
155 The transaction this IDBObjectStore belongs to is not active.
156 Expecting exception from storeFromInactiveTransaction.add(0, 0)
157 PASS Exception was thrown.
159 PASS ename is 'TransactionInactiveError'
160 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
161 The data being stored could not be cloned by the internal structured cloning algorithm.
162 Expecting exception from store.add(self, 0)
163 PASS Exception was thrown.
164 PASS code is DOMException.DATA_CLONE_ERR
165 Exception message: Failed to execute 'add' on 'IDBObjectStore': An object could not be cloned.
167 IDBObjectStore.clear()
168 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
169 Expecting exception from storeFromReadOnlyTransaction.clear()
170 PASS Exception was thrown.
172 PASS ename is 'ReadOnlyError'
173 Exception message: Failed to execute 'clear' on 'IDBObjectStore': The transaction is read-only.
174 The transaction this IDBObjectStore belongs to is not active.
175 Expecting exception from storeFromInactiveTransaction.clear()
176 PASS Exception was thrown.
178 PASS ename is 'TransactionInactiveError'
179 Exception message: Failed to execute 'clear' on 'IDBObjectStore': The transaction has finished.
181 IDBObjectStore.count()
182 If the optional key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
183 Expecting exception from store.count({})
184 PASS Exception was thrown.
186 PASS ename is 'DataError'
187 Exception message: Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key.
188 The transaction this IDBObjectStore belongs to is not active.
189 Expecting exception from storeFromInactiveTransaction.count()
190 PASS Exception was thrown.
192 PASS ename is 'TransactionInactiveError'
193 Exception message: Failed to execute 'count' on 'IDBObjectStore': The transaction has finished.
195 IDBObjectStore.delete()
196 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
197 Expecting exception from storeFromReadOnlyTransaction.delete(0)
198 PASS Exception was thrown.
200 PASS ename is 'ReadOnlyError'
201 Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.
202 If the key parameter is not a valid key or a key range this method throws a DOMException of type DataError.
203 Expecting exception from store.delete({})
204 PASS Exception was thrown.
206 PASS ename is 'DataError'
207 Exception message: Failed to execute 'delete' on 'IDBObjectStore': The parameter is not a valid key.
208 The transaction this IDBObjectStore belongs to is not active.
209 Expecting exception from storeFromInactiveTransaction.add(0, 0)
210 PASS Exception was thrown.
212 PASS ename is 'TransactionInactiveError'
213 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
216 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
217 Expecting exception from store.get({})
218 PASS Exception was thrown.
220 PASS ename is 'DataError'
221 Exception message: Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.
222 The transaction this IDBObjectStore belongs to is not active.
223 Expecting exception from storeFromInactiveTransaction.get(0)
224 PASS Exception was thrown.
226 PASS ename is 'TransactionInactiveError'
227 Exception message: Failed to execute 'get' on 'IDBObjectStore': The transaction has finished.
229 IDBObjectStore.getAll()
230 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
231 Expecting exception from store.getAll({})
232 PASS Exception was thrown.
234 PASS ename is 'DataError'
235 Exception message: Failed to execute 'getAll' on 'IDBObjectStore': The parameter is not a valid key.
236 The transaction this IDBObjectStore belongs to is not active.
237 Expecting exception from storeFromInactiveTransaction.getAll(0)
238 PASS Exception was thrown.
240 PASS ename is 'TransactionInactiveError'
241 Exception message: Failed to execute 'getAll' on 'IDBObjectStore': The transaction has finished.
243 IDBObjectStore.getAllKeys()
244 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
245 Expecting exception from store.getAllKeys({})
246 PASS Exception was thrown.
248 PASS ename is 'DataError'
249 Exception message: Failed to execute 'getAllKeys' on 'IDBObjectStore': The parameter is not a valid key.
250 The transaction this IDBObjectStore belongs to is not active.
251 Expecting exception from storeFromInactiveTransaction.getAllKeys(0)
252 PASS Exception was thrown.
254 PASS ename is 'TransactionInactiveError'
255 Exception message: Failed to execute 'getAllKeys' on 'IDBObjectStore': The transaction has finished.
257 IDBObjectStore.index()
258 There is no index with the given name, compared in a case-sensitive manner, in the connected database.
259 Expecting exception from store.index('no-such-index')
260 PASS Exception was thrown.
261 PASS code is DOMException.NOT_FOUND_ERR
262 PASS ename is 'NotFoundError'
263 Exception message: Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.
264 Occurs if a request is made on a source object that has been deleted or removed, or if the transaction the object store belongs to has finished.
265 Expecting exception from storeFromInactiveTransaction.index('index')
266 PASS Exception was thrown.
267 PASS code is DOMException.INVALID_STATE_ERR
268 PASS ename is 'InvalidStateError'
269 Exception message: Failed to execute 'index' on 'IDBObjectStore': The transaction has finished.
271 IDBObjectStore.openCursor()
272 If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
273 Expecting exception from store.openCursor({})
274 PASS Exception was thrown.
276 PASS ename is 'DataError'
277 Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The parameter is not a valid key.
278 The transaction this IDBObjectStore belongs to is not active.
279 Expecting exception from storeFromInactiveTransaction.openCursor()
280 PASS Exception was thrown.
282 PASS ename is 'TransactionInactiveError'
283 Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The transaction has finished.
284 The value for the direction parameter is invalid.
285 Expecting TypeError exception from store.openCursor(0, 'invalid-direction')
286 PASS Exception was thrown.
287 PASS store.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBObjectStore': The provided value 'invalid-direction' is not a valid enum value of type IDBCursorDirection.
289 IDBObjectStore.openKeyCursor()
290 If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
291 Expecting exception from store.openKeyCursor({})
292 PASS Exception was thrown.
294 PASS ename is 'DataError'
295 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The parameter is not a valid key.
296 The transaction this IDBObjectStore belongs to is not active.
297 Expecting exception from storeFromInactiveTransaction.openKeyCursor()
298 PASS Exception was thrown.
300 PASS ename is 'TransactionInactiveError'
301 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The transaction has finished.
302 The value for the direction parameter is invalid.
303 Expecting TypeError exception from store.openKeyCursor(0, 'invalid-direction')
304 PASS Exception was thrown.
305 PASS store.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.
308 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly".
309 Expecting exception from storeFromReadOnlyTransaction.put(0, 0)
310 PASS Exception was thrown.
312 PASS ename is 'ReadOnlyError'
313 Exception message: Failed to execute 'put' on 'IDBObjectStore': The transaction is read-only.
314 The transaction this IDBObjectStore belongs to is not active.
315 Expecting exception from storeFromInactiveTransaction.put(0, 0)
316 PASS Exception was thrown.
318 PASS ename is 'TransactionInactiveError'
319 Exception message: Failed to execute 'put' on 'IDBObjectStore': The transaction has finished.
320 The data being stored could not be cloned by the internal structured cloning algorithm.
321 Expecting exception from store.put(self, 0)
322 PASS Exception was thrown.
323 PASS code is DOMException.DATA_CLONE_ERR
324 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
326 ro_transaction.oncomplete = transactionComplete
327 rw_transaction.oncomplete = transactionComplete
329 transactionComplete():
330 First transaction completed
332 transactionComplete():
333 request = indexedDB.open(dbname, 3)
334 request.onupgradeneeded = onUpgradeNeeded3
336 IDBObjectStore.createIndex()
337 If an index with the same name already exists, the implementation must throw a DOMException of type ConstraintError.
338 Expecting exception from store.createIndex('index', 'keyPath')
339 PASS Exception was thrown.
341 PASS ename is 'ConstraintError'
342 Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.
343 If keyPath is not a valid key path then a DOMException of type SyntaxError must be thrown.
344 Expecting exception from store.createIndex('fail', '-invalid-')
345 PASS Exception was thrown.
346 PASS code is DOMException.SYNTAX_ERR
347 PASS ename is 'SyntaxError'
348 Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.
349 If keyPath is an Array and the multiEntry property in the optionalParameters is true, then a DOMException of type InvalidAccessError must be thrown.
350 Expecting exception from store.createIndex('fail', ['a'], {multiEntry: true})
351 PASS Exception was thrown.
352 PASS code is DOMException.INVALID_ACCESS_ERR
353 PASS ename is 'InvalidAccessError'
354 Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.
356 IDBObjectStore.deleteIndex()
357 There is no index with the given name, compared in a case-sensitive manner, in the connected database.
358 Expecting exception from store.deleteIndex('no-such-index')
359 PASS Exception was thrown.
360 PASS code is DOMException.NOT_FOUND_ERR
361 PASS ename is 'NotFoundError'
362 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The specified index was not found.
364 One more IDBObjectStore.createIndex() test:
365 If this function is called from outside a "versionchange" transaction callback ... the implementation must throw a DOMException of type InvalidStateError.
366 Expecting exception from db.transaction('store').objectStore('store').createIndex('fail', 'keyPath')
367 PASS Exception was thrown.
368 PASS code is DOMException.INVALID_STATE_ERR
369 PASS ename is 'InvalidStateError'
370 Exception message: Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.
372 One more IDBObjectStore.deleteIndex() test:
373 If this function is called from outside a "versionchange" transaction callback ... the implementation must throw a DOMException of type InvalidStateError.
374 Expecting exception from db.transaction('store').objectStore('store').deleteIndex('fail', 'keyPath')
375 PASS Exception was thrown.
376 PASS code is DOMException.INVALID_STATE_ERR
377 PASS ename is 'InvalidStateError'
378 Exception message: Failed to execute 'deleteIndex' on 'IDBObjectStore': The database is not running a version change transaction.
381 indexFromReadOnlyTransaction = db.transaction('store', 'readonly').objectStore('store').index('index')
382 index = db.transaction('store', 'readwrite').objectStore('store').index('index')
385 If the optional key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
386 Expecting exception from index.count({})
387 PASS Exception was thrown.
389 PASS ename is 'DataError'
390 Exception message: Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.
391 The transaction this IDBIndex belongs to is not active.
392 Expecting exception from indexFromInactiveTransaction.count()
393 PASS Exception was thrown.
395 PASS ename is 'TransactionInactiveError'
396 Exception message: Failed to execute 'count' on 'IDBIndex': The transaction has finished.
399 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
400 Expecting exception from index.get({})
401 PASS Exception was thrown.
403 PASS ename is 'DataError'
404 Exception message: Failed to execute 'get' on 'IDBIndex': The parameter is not a valid key.
405 The transaction this IDBIndex belongs to is not active.
406 Expecting exception from indexFromInactiveTransaction.get(0)
407 PASS Exception was thrown.
409 PASS ename is 'TransactionInactiveError'
410 Exception message: Failed to execute 'get' on 'IDBIndex': The transaction has finished.
413 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
414 Expecting exception from index.getAll({})
415 PASS Exception was thrown.
417 PASS ename is 'DataError'
418 Exception message: Failed to execute 'getAll' on 'IDBIndex': The parameter is not a valid key.
419 The transaction this IDBIndex belongs to is not active.
420 Expecting exception from indexFromInactiveTransaction.getAll(0)
421 PASS Exception was thrown.
423 PASS ename is 'TransactionInactiveError'
424 Exception message: Failed to execute 'getAll' on 'IDBIndex': The transaction has finished.
427 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
428 Expecting exception from index.getKey({})
429 PASS Exception was thrown.
431 PASS ename is 'DataError'
432 Exception message: Failed to execute 'getKey' on 'IDBIndex': The parameter is not a valid key.
433 The transaction this IDBIndex belongs to is not active.
434 Expecting exception from indexFromInactiveTransaction.getKey(0)
435 PASS Exception was thrown.
437 PASS ename is 'TransactionInactiveError'
438 Exception message: Failed to execute 'getKey' on 'IDBIndex': The transaction has finished.
440 IDBIndex.getAllKeys()
441 If the key parameter is not a valid key or a key range, this method throws a DOMException of type DataError.
442 Expecting exception from index.getAllKeys({})
443 PASS Exception was thrown.
445 PASS ename is 'DataError'
446 Exception message: Failed to execute 'getAllKeys' on 'IDBIndex': The parameter is not a valid key.
447 The transaction this IDBIndex belongs to is not active.
448 Expecting exception from indexFromInactiveTransaction.getAllKeys(0)
449 PASS Exception was thrown.
451 PASS ename is 'TransactionInactiveError'
452 Exception message: Failed to execute 'getAllKeys' on 'IDBIndex': The transaction has finished.
454 IDBIndex.openCursor()
455 If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
456 Expecting exception from index.openCursor({})
457 PASS Exception was thrown.
459 PASS ename is 'DataError'
460 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The parameter is not a valid key.
461 The transaction this IDBIndex belongs to is not active.
462 Expecting exception from indexFromInactiveTransaction.openCursor()
463 PASS Exception was thrown.
465 PASS ename is 'TransactionInactiveError'
466 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction has finished.
467 The value for the direction parameter is invalid.
468 Expecting TypeError exception from index.openCursor(0, 'invalid-direction')
469 PASS Exception was thrown.
470 PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value of type IDBCursorDirection.
472 IDBIndex.openKeyCursor()
473 If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError.
474 Expecting exception from index.openKeyCursor({})
475 PASS Exception was thrown.
477 PASS ename is 'DataError'
478 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The parameter is not a valid key.
479 The transaction this IDBIndex belongs to is not active.
480 Expecting exception from indexFromInactiveTransaction.openKeyCursor()
481 PASS Exception was thrown.
483 PASS ename is 'TransactionInactiveError'
484 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction has finished.
485 The value for the direction parameter is invalid.
486 Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction')
487 PASS Exception was thrown.
488 PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value of type IDBCursorDirection.
491 transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite')
492 request = transaction.objectStore('store').openCursor()
493 cursor = request.result
494 request = transaction.objectStore('store').index('index').openKeyCursor()
495 keyCursor = request.result
496 request = transaction.objectStore('store').openCursor(IDBKeyRange.lowerBound(-Infinity), 'prev')
497 reverseCursor = request.result
498 request = transaction.objectStore('inlineKeyStore').openCursor()
499 inlineCursor = request.result
502 Calling this method more than once before new cursor data has been loaded is not allowed and results in a DOMException of type InvalidStateError being thrown.
503 If the value for count is 0 (zero) or a negative number, this method must throw a JavaScript TypeError exception.
504 Expecting TypeError exception from cursor.advance(0)
505 PASS Exception was thrown.
506 PASS cursor.advance(0) threw TypeError: Failed to execute 'advance' on 'IDBCursor': A count argument with value 0 (zero) was supplied, must be greater than 0.
508 Expecting exception from cursor.advance(1)
509 PASS Exception was thrown.
510 PASS code is DOMException.INVALID_STATE_ERR
511 PASS ename is 'InvalidStateError'
512 Exception message: Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
513 The transaction this IDBCursor belongs to is not active.
514 Expecting exception from cursorFromInactiveTransaction.advance(1)
515 PASS Exception was thrown.
517 PASS ename is 'TransactionInactiveError'
518 Exception message: Failed to execute 'advance' on 'IDBCursor': The transaction has finished.
521 The parameter is not a valid key.
522 Expecting exception from cursor.continue({})
523 PASS Exception was thrown.
525 PASS ename is 'DataError'
526 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is not a valid key.
527 The parameter is less than or equal to this cursor's position and this cursor's direction is "next" or "nextunique".
528 Expecting exception from cursor.continue(-Infinity)
529 PASS Exception was thrown.
531 PASS ename is 'DataError'
532 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.
533 The parameter is greater than or equal to this cursor's position and this cursor's direction is "prev" or "prevunique".
534 Expecting exception from reverseCursor.continue(100)
535 PASS Exception was thrown.
537 PASS ename is 'DataError'
538 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is greater than or equal to this cursor's position.
539 Calling this method more than once before new cursor data has been loaded is not allowed and results in a DOMException of type InvalidStateError being thrown.
541 Expecting exception from cursor.continue()
542 PASS Exception was thrown.
543 PASS code is DOMException.INVALID_STATE_ERR
544 PASS ename is 'InvalidStateError'
545 Exception message: Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.
546 The transaction this IDBCursor belongs to is not active.
547 Expecting exception from cursorFromInactiveTransaction.continue()
548 PASS Exception was thrown.
550 PASS ename is 'TransactionInactiveError'
551 Exception message: Failed to execute 'continue' on 'IDBCursor': The transaction has finished.
554 If this cursor's got value flag is false, or if this cursor was created using openKeyCursor a DOMException of type InvalidStateError is thrown.
555 Expecting exception from keyCursor.delete()
556 PASS Exception was thrown.
557 PASS code is DOMException.INVALID_STATE_ERR
558 PASS ename is 'InvalidStateError'
559 Exception message: Failed to execute 'delete' on 'IDBCursor': The cursor is a key cursor.
560 The transaction this IDBCursor belongs to is not active.
561 Expecting exception from cursorFromInactiveTransaction.delete()
562 PASS Exception was thrown.
564 PASS ename is 'TransactionInactiveError'
565 Exception message: Failed to execute 'delete' on 'IDBCursor': The transaction has finished.
568 If this cursor's got value flag is false or if this cursor was created using openKeyCursor. This method throws a DOMException of type InvalidStateError.
569 Expecting exception from keyCursor.update({})
570 PASS Exception was thrown.
571 PASS code is DOMException.INVALID_STATE_ERR
572 PASS ename is 'InvalidStateError'
573 Exception message: Failed to execute 'update' on 'IDBCursor': The cursor is a key cursor.
574 If the effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key, this method throws a DOMException of type DataError.
575 Expecting exception from inlineCursor.update({id: 1})
576 PASS Exception was thrown.
578 PASS ename is 'DataError'
579 Exception message: Failed to execute 'update' on 'IDBCursor': The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.
580 If the structured clone algorithm throws an exception, that exception is rethrown.
581 Expecting exception from cursor.update(self)
582 PASS Exception was thrown.
583 PASS code is DOMException.DATA_CLONE_ERR
584 Exception message: Failed to execute 'update' on 'IDBCursor': An object could not be cloned.
585 The transaction this IDBCursor belongs to is not active.
586 Expecting exception from cursorFromInactiveTransaction.update({})
587 PASS Exception was thrown.
589 PASS ename is 'TransactionInactiveError'
590 Exception message: Failed to execute 'update' on 'IDBCursor': The transaction has finished.
591 readOnlyTransaction = db.transaction('store', 'readonly')
592 request = readOnlyTransaction.objectStore('store').openCursor()
593 cursorFromReadOnlyTransaction = request.result
595 One more IDBCursor.delete() test:
596 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBCursor belongs to has its mode set to "readonly".
597 Expecting exception from cursorFromReadOnlyTransaction.delete()
598 PASS Exception was thrown.
600 PASS ename is 'ReadOnlyError'
601 Exception message: Failed to execute 'delete' on 'IDBCursor': The record may not be deleted inside a read-only transaction.
603 One more IDBCursor.update() test:
604 This method throws a DOMException of type ReadOnlyError if the transaction which this IDBCursor belongs to has its mode set to "readonly".
605 Expecting exception from cursorFromReadOnlyTransaction.update({})
606 PASS Exception was thrown.
608 PASS ename is 'ReadOnlyError'
609 Exception message: Failed to execute 'update' on 'IDBCursor': The record may not be updated inside a read-only transaction.
613 IDBTransaction.abort()
614 If this transaction is finished, throw a DOMException of type InvalidStateError.
615 Expecting exception from finishedTransaction.abort()
616 PASS Exception was thrown.
617 PASS code is DOMException.INVALID_STATE_ERR
618 PASS ename is 'InvalidStateError'
619 Exception message: Failed to execute 'abort' on 'IDBTransaction': The transaction has finished.
620 If the requested object store is not in this transaction's scope.
621 Expecting exception from db.transaction('store').objectStore('otherStore')
622 PASS Exception was thrown.
623 PASS code is DOMException.NOT_FOUND_ERR
624 PASS ename is 'NotFoundError'
625 Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The specified object store was not found.
626 PASS successfullyParsed is true