| OLD | NEW |
| 1 if (this.importScripts) { | 1 if (this.importScripts) { |
| 2 importScripts('../../../resources/js-test.js'); | 2 importScripts('../../../resources/js-test.js'); |
| 3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
| 4 } | 4 } |
| 5 | 5 |
| 6 description("Test that expected exceptions are thrown per IndexedDB spec."); | 6 description("Test that expected exceptions are thrown per IndexedDB spec."); |
| 7 | 7 |
| 8 indexedDBTest(prepareDatabase, testDatabase); | 8 indexedDBTest(prepareDatabase, testDatabase); |
| 9 function prepareDatabase() | 9 function prepareDatabase() |
| 10 { | 10 { |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 debug(""); | 320 debug(""); |
| 321 debug("IDBIndex.getKey()"); | 321 debug("IDBIndex.getKey()"); |
| 322 debug("If the key parameter is not a valid key or a key range, this method t
hrows a DOMException of type DataError."); | 322 debug("If the key parameter is not a valid key or a key range, this method t
hrows a DOMException of type DataError."); |
| 323 evalAndExpectException("index.getKey({})", "0", "'DataError'"); | 323 evalAndExpectException("index.getKey({})", "0", "'DataError'"); |
| 324 debug("The transaction this IDBIndex belongs to is not active."); | 324 debug("The transaction this IDBIndex belongs to is not active."); |
| 325 evalAndExpectException("indexFromInactiveTransaction.getKey(0)", "0", "'Tran
sactionInactiveError'"); | 325 evalAndExpectException("indexFromInactiveTransaction.getKey(0)", "0", "'Tran
sactionInactiveError'"); |
| 326 // "Occurs if a request is made on a source object that has been deleted or
removed." - covered in deleted-objects.html | 326 // "Occurs if a request is made on a source object that has been deleted or
removed." - covered in deleted-objects.html |
| 327 | 327 |
| 328 debug(""); | 328 debug(""); |
| 329 debug("IDBIndex.getAllKeys()"); |
| 330 debug("If the key parameter is not a valid key or a key range, this method t
hrows a DOMException of type DataError."); |
| 331 evalAndExpectException("index.getAllKeys({})", "0", "'DataError'"); |
| 332 debug("The transaction this IDBIndex belongs to is not active."); |
| 333 evalAndExpectException("indexFromInactiveTransaction.getAllKeys(0)", "0", "'
TransactionInactiveError'"); |
| 334 // "Occurs if a request is made on a source object that has been deleted or
removed." - covered in deleted-objects.html |
| 335 |
| 336 debug(""); |
| 329 debug("IDBIndex.openCursor()"); | 337 debug("IDBIndex.openCursor()"); |
| 330 debug("If the range parameter is specified but is not a valid key or a key r
ange, this method throws a DOMException of type DataError."); | 338 debug("If the range parameter is specified but is not a valid key or a key r
ange, this method throws a DOMException of type DataError."); |
| 331 evalAndExpectException("index.openCursor({})", "0", "'DataError'"); | 339 evalAndExpectException("index.openCursor({})", "0", "'DataError'"); |
| 332 debug("The transaction this IDBIndex belongs to is not active."); | 340 debug("The transaction this IDBIndex belongs to is not active."); |
| 333 evalAndExpectException("indexFromInactiveTransaction.openCursor()", "0", "'T
ransactionInactiveError'"); | 341 evalAndExpectException("indexFromInactiveTransaction.openCursor()", "0", "'T
ransactionInactiveError'"); |
| 334 debug("The value for the direction parameter is invalid."); | 342 debug("The value for the direction parameter is invalid."); |
| 335 evalAndExpectExceptionClass("index.openCursor(0, 'invalid-direction')", "Typ
eError"); | 343 evalAndExpectExceptionClass("index.openCursor(0, 'invalid-direction')", "Typ
eError"); |
| 336 // "Occurs if a request is made on a source object that has been deleted or
removed." - covered in deleted-objects.html | 344 // "Occurs if a request is made on a source object that has been deleted or
removed." - covered in deleted-objects.html |
| 337 | 345 |
| 338 debug(""); | 346 debug(""); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 494 |
| 487 debug(""); | 495 debug(""); |
| 488 debug("IDBTransaction.abort()"); | 496 debug("IDBTransaction.abort()"); |
| 489 debug("If this transaction is finished, throw a DOMException of type Invalid
StateError. "); | 497 debug("If this transaction is finished, throw a DOMException of type Invalid
StateError. "); |
| 490 evalAndExpectException("finishedTransaction.abort()", "DOMException.INVALID_
STATE_ERR", "'InvalidStateError'"); | 498 evalAndExpectException("finishedTransaction.abort()", "DOMException.INVALID_
STATE_ERR", "'InvalidStateError'"); |
| 491 debug("If the requested object store is not in this transaction's scope."); | 499 debug("If the requested object store is not in this transaction's scope."); |
| 492 evalAndExpectException("db.transaction('store').objectStore('otherStore')",
"DOMException.NOT_FOUND_ERR", "'NotFoundError'"); | 500 evalAndExpectException("db.transaction('store').objectStore('otherStore')",
"DOMException.NOT_FOUND_ERR", "'NotFoundError'"); |
| 493 | 501 |
| 494 finishJSTest(); | 502 finishJSTest(); |
| 495 } | 503 } |
| OLD | NEW |