Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: LayoutTests/storage/indexeddb/resources/createIndex-after-failure.js

Issue 291243003: IndexedDB: Test updates for store/index deletion race (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Enable tests Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/storage/indexeddb/createObjectStore-put-deleteObjectStore-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « LayoutTests/storage/indexeddb/createObjectStore-put-deleteObjectStore-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698