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

Unified Diff: webkit/dom_storage/dom_storage_area_unittest.cc

Issue 10389061: DomStorageArea: Allow multiple simultaneous in flight commit batches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/dom_storage/dom_storage_area.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_area_unittest.cc
diff --git a/webkit/dom_storage/dom_storage_area_unittest.cc b/webkit/dom_storage/dom_storage_area_unittest.cc
index 12ccfd8d140153cb93ee75738075a2de6a1bbef8..858eb2362af22d338576102e031fff3a04d285c6 100644
--- a/webkit/dom_storage/dom_storage_area_unittest.cc
+++ b/webkit/dom_storage/dom_storage_area_unittest.cc
@@ -38,7 +38,7 @@ class DomStorageAreaTest : public testing::Test {
void InjectedCommitSequencingTask(DomStorageArea* area) {
// At this point the OnCommitTimer has run.
// Verify that it put a commit in flight.
- EXPECT_TRUE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(1, area->commit_batches_in_flight_);
EXPECT_FALSE(area->commit_batch_.get());
EXPECT_TRUE(area->HasUncommittedChanges());
// Make additional change and verify that a new commit batch
@@ -46,7 +46,7 @@ class DomStorageAreaTest : public testing::Test {
NullableString16 old_value;
EXPECT_TRUE(area->SetItem(kKey2, kValue2, &old_value));
EXPECT_TRUE(area->commit_batch_.get());
- EXPECT_TRUE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(1, area->commit_batches_in_flight_);
EXPECT_TRUE(area->HasUncommittedChanges());
}
@@ -174,12 +174,12 @@ TEST_F(DomStorageAreaTest, BackingDatabaseOpened) {
ASSERT_TRUE(old_value.is_null());
EXPECT_TRUE(area->is_initial_import_done_);
EXPECT_TRUE(area->commit_batch_.get());
- EXPECT_FALSE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(0, area->commit_batches_in_flight_);
MessageLoop::current()->RunAllPending();
EXPECT_FALSE(area->commit_batch_.get());
- EXPECT_FALSE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(0, area->commit_batches_in_flight_);
EXPECT_TRUE(area->backing_->IsOpen());
EXPECT_EQ(1u, area->Length());
EXPECT_EQ(kValue, area->GetItem(kKey).string());
@@ -226,7 +226,7 @@ TEST_F(DomStorageAreaTest, CommitTasks) {
MessageLoop::current()->RunAllPending();
EXPECT_FALSE(area->HasUncommittedChanges());
EXPECT_FALSE(area->commit_batch_.get());
- EXPECT_FALSE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(0, area->commit_batches_in_flight_);
// Verify the changes made it to the database.
values.clear();
area->backing_->ReadAllValues(&values);
@@ -241,7 +241,7 @@ TEST_F(DomStorageAreaTest, CommitTasks) {
EXPECT_TRUE(area->commit_batch_->changed_values.empty());
MessageLoop::current()->RunAllPending();
EXPECT_FALSE(area->commit_batch_.get());
- EXPECT_FALSE(area->in_flight_commit_batch_.get());
+ EXPECT_EQ(0, area->commit_batches_in_flight_);
// Verify the changes made it to the database.
values.clear();
area->backing_->ReadAllValues(&values);
« no previous file with comments | « webkit/dom_storage/dom_storage_area.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698