OLD | NEW |
1 Test that expected exceptions are thrown per IndexedDB spec. | 1 Test that expected exceptions are thrown per IndexedDB spec. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "exceptions.html" | 8 dbname = "exceptions.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Exception message: Failed to execute 'transaction' on 'IDBDatabase': A version c
hange transaction is running. | 99 Exception message: Failed to execute 'transaction' on 'IDBDatabase': A version c
hange transaction is running. |
100 One of the names provided in the storeNames argument doesn't exist in this datab
ase. | 100 One of the names provided in the storeNames argument doesn't exist in this datab
ase. |
101 Expecting exception from db.transaction('no-such-store') | 101 Expecting exception from db.transaction('no-such-store') |
102 PASS Exception was thrown. | 102 PASS Exception was thrown. |
103 PASS code is DOMException.NOT_FOUND_ERR | 103 PASS code is DOMException.NOT_FOUND_ERR |
104 PASS ename is 'NotFoundError' | 104 PASS ename is 'NotFoundError' |
105 Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the
specified object stores was not found. | 105 Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the
specified object stores was not found. |
106 The value for the mode parameter is invalid. | 106 The value for the mode parameter is invalid. |
107 Expecting TypeError exception from db.transaction('store', 'invalid-mode') | 107 Expecting TypeError exception from db.transaction('store', 'invalid-mode') |
108 PASS Exception was thrown. | 108 PASS Exception was thrown. |
109 PASS db.transaction('store', 'invalid-mode') threw TypeError: Failed to execute
'transaction' on 'IDBDatabase': parameter 2 ('invalid-mode') is not a valid enum
value. | 109 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. |
110 The 'versionchange' value for the mode parameter can only be set internally duri
ng upgradeneeded. | 110 The 'versionchange' value for the mode parameter can only be set internally duri
ng upgradeneeded. |
111 Expecting TypeError exception from db.transaction('store', 'versionchange') | 111 Expecting TypeError exception from db.transaction('store', 'versionchange') |
112 PASS Exception was thrown. | 112 PASS Exception was thrown. |
113 PASS db.transaction('store', 'versionchange') threw TypeError: Failed to execute
'transaction' on 'IDBDatabase': The mode provided ('versionchange') is not one
of 'readonly' or 'readwrite'. | 113 PASS db.transaction('store', 'versionchange') threw TypeError: Failed to execute
'transaction' on 'IDBDatabase': The mode provided ('versionchange') is not one
of 'readonly' or 'readwrite'. |
114 The function was called with an empty list of store names | 114 The function was called with an empty list of store names |
115 Expecting exception from db.transaction([]) | 115 Expecting exception from db.transaction([]) |
116 PASS Exception was thrown. | 116 PASS Exception was thrown. |
117 PASS code is DOMException.INVALID_ACCESS_ERR | 117 PASS code is DOMException.INVALID_ACCESS_ERR |
118 PASS ename is 'InvalidAccessError' | 118 PASS ename is 'InvalidAccessError' |
119 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The storeNa
mes parameter was empty. | 119 Exception message: Failed to execute 'transaction' on 'IDBDatabase': The storeNa
mes parameter was empty. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The pa
rameter is not a valid key. | 269 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The pa
rameter is not a valid key. |
270 The transaction this IDBObjectStore belongs to is not active. | 270 The transaction this IDBObjectStore belongs to is not active. |
271 Expecting exception from storeFromInactiveTransaction.openKeyCursor() | 271 Expecting exception from storeFromInactiveTransaction.openKeyCursor() |
272 PASS Exception was thrown. | 272 PASS Exception was thrown. |
273 PASS code is 0 | 273 PASS code is 0 |
274 PASS ename is 'TransactionInactiveError' | 274 PASS ename is 'TransactionInactiveError' |
275 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The tr
ansaction has finished. | 275 Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The tr
ansaction has finished. |
276 The value for the direction parameter is invalid. | 276 The value for the direction parameter is invalid. |
277 Expecting TypeError exception from store.openKeyCursor(0, 'invalid-direction') | 277 Expecting TypeError exception from store.openKeyCursor(0, 'invalid-direction') |
278 PASS Exception was thrown. | 278 PASS Exception was thrown. |
279 PASS store.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to exec
ute 'openKeyCursor' on 'IDBObjectStore': parameter 2 ('invalid-direction') is no
t a valid enum value. | 279 PASS store.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to exec
ute 'openKeyCursor' on 'IDBObjectStore': The provided value 'invalid-direction'
is not a valid enum value. |
280 | 280 |
281 IDBObjectStore.put() | 281 IDBObjectStore.put() |
282 This method throws a DOMException of type ReadOnlyError if the transaction which
this IDBObjectStore belongs to is has its mode set to "readonly". | 282 This method throws a DOMException of type ReadOnlyError if the transaction which
this IDBObjectStore belongs to is has its mode set to "readonly". |
283 Expecting exception from storeFromReadOnlyTransaction.put(0, 0) | 283 Expecting exception from storeFromReadOnlyTransaction.put(0, 0) |
284 PASS Exception was thrown. | 284 PASS Exception was thrown. |
285 PASS code is 0 | 285 PASS code is 0 |
286 PASS ename is 'ReadOnlyError' | 286 PASS ename is 'ReadOnlyError' |
287 Exception message: Failed to execute 'put' on 'IDBObjectStore': The transaction
is read-only. | 287 Exception message: Failed to execute 'put' on 'IDBObjectStore': The transaction
is read-only. |
288 The transaction this IDBObjectStore belongs to is not active. | 288 The transaction this IDBObjectStore belongs to is not active. |
289 Expecting exception from storeFromInactiveTransaction.put(0, 0) | 289 Expecting exception from storeFromInactiveTransaction.put(0, 0) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The parameter i
s not a valid key. | 406 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The parameter i
s not a valid key. |
407 The transaction this IDBIndex belongs to is not active. | 407 The transaction this IDBIndex belongs to is not active. |
408 Expecting exception from indexFromInactiveTransaction.openCursor() | 408 Expecting exception from indexFromInactiveTransaction.openCursor() |
409 PASS Exception was thrown. | 409 PASS Exception was thrown. |
410 PASS code is 0 | 410 PASS code is 0 |
411 PASS ename is 'TransactionInactiveError' | 411 PASS ename is 'TransactionInactiveError' |
412 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction
has finished. | 412 Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction
has finished. |
413 The value for the direction parameter is invalid. | 413 The value for the direction parameter is invalid. |
414 Expecting TypeError exception from index.openCursor(0, 'invalid-direction') | 414 Expecting TypeError exception from index.openCursor(0, 'invalid-direction') |
415 PASS Exception was thrown. | 415 PASS Exception was thrown. |
416 PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute
'openCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid en
um value. | 416 PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute
'openCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a val
id enum value. |
417 | 417 |
418 IDBIndex.openKeyCursor() | 418 IDBIndex.openKeyCursor() |
419 If the range parameter is specified but is not a valid key or a key range, this
method throws a DOMException of type DataError. | 419 If the range parameter is specified but is not a valid key or a key range, this
method throws a DOMException of type DataError. |
420 Expecting exception from index.openKeyCursor({}) | 420 Expecting exception from index.openKeyCursor({}) |
421 PASS Exception was thrown. | 421 PASS Exception was thrown. |
422 PASS code is 0 | 422 PASS code is 0 |
423 PASS ename is 'DataError' | 423 PASS ename is 'DataError' |
424 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The paramete
r is not a valid key. | 424 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The paramete
r is not a valid key. |
425 The transaction this IDBIndex belongs to is not active. | 425 The transaction this IDBIndex belongs to is not active. |
426 Expecting exception from indexFromInactiveTransaction.openKeyCursor() | 426 Expecting exception from indexFromInactiveTransaction.openKeyCursor() |
427 PASS Exception was thrown. | 427 PASS Exception was thrown. |
428 PASS code is 0 | 428 PASS code is 0 |
429 PASS ename is 'TransactionInactiveError' | 429 PASS ename is 'TransactionInactiveError' |
430 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transact
ion has finished. | 430 Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transact
ion has finished. |
431 The value for the direction parameter is invalid. | 431 The value for the direction parameter is invalid. |
432 Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction') | 432 Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction') |
433 PASS Exception was thrown. | 433 PASS Exception was thrown. |
434 PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to exec
ute 'openKeyCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a va
lid enum value. | 434 PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to exec
ute 'openKeyCursor' on 'IDBIndex': The provided value 'invalid-direction' is not
a valid enum value. |
435 | 435 |
436 3.2.7 Cursor | 436 3.2.7 Cursor |
437 transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite') | 437 transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite') |
438 request = transaction.objectStore('store').openCursor() | 438 request = transaction.objectStore('store').openCursor() |
439 cursor = request.result | 439 cursor = request.result |
440 request = transaction.objectStore('store').index('index').openKeyCursor() | 440 request = transaction.objectStore('store').index('index').openKeyCursor() |
441 keyCursor = request.result | 441 keyCursor = request.result |
442 request = transaction.objectStore('store').openCursor(IDBKeyRange.lowerBound(-In
finity), 'prev') | 442 request = transaction.objectStore('store').openCursor(IDBKeyRange.lowerBound(-In
finity), 'prev') |
443 reverseCursor = request.result | 443 reverseCursor = request.result |
444 request = transaction.objectStore('inlineKeyStore').openCursor() | 444 request = transaction.objectStore('inlineKeyStore').openCursor() |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 If the requested object store is not in this transaction's scope. | 566 If the requested object store is not in this transaction's scope. |
567 Expecting exception from db.transaction('store').objectStore('otherStore') | 567 Expecting exception from db.transaction('store').objectStore('otherStore') |
568 PASS Exception was thrown. | 568 PASS Exception was thrown. |
569 PASS code is DOMException.NOT_FOUND_ERR | 569 PASS code is DOMException.NOT_FOUND_ERR |
570 PASS ename is 'NotFoundError' | 570 PASS ename is 'NotFoundError' |
571 Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The spec
ified object store was not found. | 571 Exception message: Failed to execute 'objectStore' on 'IDBTransaction': The spec
ified object store was not found. |
572 PASS successfullyParsed is true | 572 PASS successfullyParsed is true |
573 | 573 |
574 TEST COMPLETE | 574 TEST COMPLETE |
575 | 575 |
OLD | NEW |