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 IndexedDB's basics."); | 6 description("Test IndexedDB's basics."); |
7 | 7 |
8 indexedDBTest(prepareDatabase); | 8 indexedDBTest(prepareDatabase); |
9 function prepareDatabase(event) | 9 function prepareDatabase(event) |
10 { | 10 { |
(...skipping 12 matching lines...) Expand all Loading... | |
23 // This will asynchronously abort in the backend because of constraint failu res. | 23 // This will asynchronously abort in the backend because of constraint failu res. |
24 evalAndLog("objectStore.createIndex('index', 'key', {unique: true})"); | 24 evalAndLog("objectStore.createIndex('index', 'key', {unique: true})"); |
25 // Now immediately delete it. | 25 // Now immediately delete it. |
26 evalAndLog("objectStore.deleteIndex('index')"); | 26 evalAndLog("objectStore.deleteIndex('index')"); |
27 // Delete it again: backend may have asynchronously aborted the | 27 // Delete it again: backend may have asynchronously aborted the |
28 // index creation, but this makes sure the frontend doesn't get | 28 // index creation, but this makes sure the frontend doesn't get |
29 // confused and crash, or think the index still exists. | 29 // confused and crash, or think the index still exists. |
30 evalAndExpectException("objectStore.deleteIndex('index')", "DOMException.NOT _FOUND_ERR", "'NotFoundError'"); | 30 evalAndExpectException("objectStore.deleteIndex('index')", "DOMException.NOT _FOUND_ERR", "'NotFoundError'"); |
31 debug("Now requesting object2"); | 31 debug("Now requesting object2"); |
32 var req3 = objectStore.get("object2"); | 32 var req3 = objectStore.get("object2"); |
33 req3.onsuccess = deleteIndexAfterGet; | 33 req3.onsuccess = unexpectedSuccessCallback; |
34 req3.onerror = unexpectedErrorCallback; | 34 req3.onerror = deleteIndexAfterGetError; |
35 debug("now we wait."); | 35 debug("now we wait."); |
36 } | 36 } |
37 | 37 |
38 function deleteIndexAfterGet() { | 38 function deleteIndexAfterGetError() { |
39 // so we will delete it next, but it should already be gone... right? | 39 debug("deleteIndexAfterGetError()"); |
40 debug("deleteIndexAfterGet()"); | |
41 // the index should still be gone, and this should not crash. | 40 // the index should still be gone, and this should not crash. |
42 evalAndExpectException("objectStore.deleteIndex('index')", "DOMException.NOT _FOUND_ERR", "'NotFoundError'"); | 41 evalAndExpectException("objectStore.deleteIndex('index')", "0", "'Transactio nInactiveError'"); |
cmumford
2014/05/23 19:57:20
Just curious: why two calls to deleteIndex?
jsbell
2014/05/23 20:09:10
I believe this test started life as a regression t
| |
43 evalAndExpectException("objectStore.deleteIndex('index')", "DOMException.NOT _FOUND_ERR", "'NotFoundError'"); | 42 evalAndExpectException("objectStore.deleteIndex('index')", "0", "'Transactio nInactiveError'"); |
44 | 43 |
45 finishJSTest(); | 44 finishJSTest(); |
46 } | 45 } |
OLD | NEW |