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

Unified Diff: sync/syncable/syncable_unittest.cc

Issue 10916174: Implement a bag of chips for sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Follow review Created 8 years, 3 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 | « sync/syncable/directory_backing_store_unittest.cc ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/syncable_unittest.cc
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc
index b74d41cf08a0a7baf90d3b8abded5e2b361897b6..f69347b75e7453b18879ac477e2130be19da82c5 100644
--- a/sync/syncable/syncable_unittest.cc
+++ b/sync/syncable/syncable_unittest.cc
@@ -1583,15 +1583,24 @@ TEST_F(OnDiskSyncableDirectoryTest, TestShareInfo) {
dir_->set_initial_sync_ended_for_type(AUTOFILL, true);
dir_->set_store_birthday("Jan 31st");
dir_->SetNotificationState("notification_state");
+ const char* const bag_of_chips_array = "\0bag of chips";
+ const std::string bag_of_chips_string =
+ std::string(bag_of_chips_array, sizeof(bag_of_chips_array));
+ dir_->set_bag_of_chips(bag_of_chips_string);
{
ReadTransaction trans(FROM_HERE, dir_.get());
EXPECT_TRUE(dir_->initial_sync_ended_for_type(AUTOFILL));
EXPECT_FALSE(dir_->initial_sync_ended_for_type(BOOKMARKS));
EXPECT_EQ("Jan 31st", dir_->store_birthday());
EXPECT_EQ("notification_state", dir_->GetNotificationState());
+ EXPECT_EQ(bag_of_chips_string, dir_->bag_of_chips());
}
dir_->set_store_birthday("April 10th");
dir_->SetNotificationState("notification_state2");
+ const char* const bag_of_chips2_array = "\0bag of chips2";
+ const std::string bag_of_chips2_string =
+ std::string(bag_of_chips2_array, sizeof(bag_of_chips2_array));
+ dir_->set_bag_of_chips(bag_of_chips2_string);
dir_->SaveChanges();
{
ReadTransaction trans(FROM_HERE, dir_.get());
@@ -1599,6 +1608,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestShareInfo) {
EXPECT_FALSE(dir_->initial_sync_ended_for_type(BOOKMARKS));
EXPECT_EQ("April 10th", dir_->store_birthday());
EXPECT_EQ("notification_state2", dir_->GetNotificationState());
+ EXPECT_EQ(bag_of_chips2_string, dir_->bag_of_chips());
}
dir_->SetNotificationState("notification_state2");
// Restore the directory from disk. Make sure that nothing's changed.
@@ -1609,6 +1619,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestShareInfo) {
EXPECT_FALSE(dir_->initial_sync_ended_for_type(BOOKMARKS));
EXPECT_EQ("April 10th", dir_->store_birthday());
EXPECT_EQ("notification_state2", dir_->GetNotificationState());
+ EXPECT_EQ(bag_of_chips2_string, dir_->bag_of_chips());
}
}
« no previous file with comments | « sync/syncable/directory_backing_store_unittest.cc ('k') | sync/test/test_directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698