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

Side by Side Diff: chrome/test/data/indexeddb/object_store_test.js

Issue 6209005: Fix IndexedDB race condition during shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing Jeremy's comments Created 9 years, 11 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 | « chrome/browser/io_thread.cc ('k') | chrome/test/data/indexeddb/transaction_run_forever.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var testDate = new Date("February 24, 1955 12:00:00"); 5 var testDate = new Date("February 24, 1955 12:00:00");
6 6
7 function getByDateSuccess() 7 function getByDateSuccess()
8 { 8 {
9 debug('Data retrieved by date key'); 9 debug('Data retrieved by date key');
10 10
11 shouldBe("event.result", "'foo'"); 11 shouldBe("event.result", "'foo'");
12 done(); 12 done();
13 } 13 }
14 14
15 function recordNotFound() 15 function recordNotFound()
16 { 16 {
17 debug('Removed data can no longer be found'); 17 debug('Removed data can no longer be found');
18 shouldBe("event.result", "undefined");
18 19
19 debug('Retrieving an index'); 20 debug('Retrieving an index');
20 shouldBe("objectStore.index('fname_index').name", "'fname_index'"); 21 shouldBe("objectStore.index('fname_index').name", "'fname_index'");
21 22
22 debug('Removing an index'); 23 debug('Removing an index');
23 try { 24 try {
24 objectStore.deleteIndex('fname_index'); 25 objectStore.deleteIndex('fname_index');
25 } catch(e) { 26 } catch(e) {
26 fail(e); 27 fail(e);
27 } 28 }
28 29
29 var result = transaction.objectStore('stuff').get(testDate); 30 var result = transaction.objectStore('stuff').get(testDate);
30 result.onsuccess = getByDateSuccess; 31 result.onsuccess = getByDateSuccess;
31 result.onerror = unexpectedErrorCallback; 32 result.onerror = unexpectedErrorCallback;
32 } 33 }
33 34
34 function removeSuccess() 35 function removeSuccess()
35 { 36 {
36 debug('Data removed'); 37 debug('Data removed');
37 38
38 var result = objectStore.get(1); 39 var result = objectStore.get(1);
39 result.onsuccess = unexpectedSuccessCallback; 40 result.onsuccess = recordNotFound;
40 result.onerror = recordNotFound; 41 result.onerror = unexpectedSuccessCallback;
41 } 42 }
42 43
43 function getSuccess() 44 function getSuccess()
44 { 45 {
45 debug('Data retrieved'); 46 debug('Data retrieved');
46 47
47 shouldBe("event.result.fname", "'John'"); 48 shouldBe("event.result.fname", "'John'");
48 shouldBe("event.result.lname", "'Doe'"); 49 shouldBe("event.result.lname", "'Doe'");
49 shouldBe("event.result.id", "1"); 50 shouldBe("event.result.id", "1");
50 51
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 result.onerror = unexpectedErrorCallback; 113 result.onerror = unexpectedErrorCallback;
113 } 114 }
114 115
115 function test() 116 function test()
116 { 117 {
117 debug('Connecting to indexedDB'); 118 debug('Connecting to indexedDB');
118 var result = webkitIndexedDB.open('name'); 119 var result = webkitIndexedDB.open('name');
119 result.onsuccess = setVersion; 120 result.onsuccess = setVersion;
120 result.onerror = unexpectedErrorCallback; 121 result.onerror = unexpectedErrorCallback;
121 } 122 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/test/data/indexeddb/transaction_run_forever.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698