Index: chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc |
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc |
index e7b0675550bc3431854fd4d9eb927d68564d4b38..f2afb87a4ed59e2822d8d6a4475a7ed865203fde 100644 |
--- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc |
+++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc |
@@ -87,7 +87,7 @@ class SupervisedUserSharedSettingsServiceTest : public ::testing::Test { |
: settings_service_(profile_.GetPrefs()) {} |
~SupervisedUserSharedSettingsServiceTest() override {} |
- void StartSyncing(const syncer::SyncDataList& initial_sync_data) { |
+ SyncMergeResult StartSyncing(const syncer::SyncDataList& initial_sync_data) { |
sync_processor_.reset(new syncer::FakeSyncChangeProcessor); |
scoped_ptr<syncer::SyncErrorFactory> error_handler( |
new MockSyncErrorFactory(SUPERVISED_USER_SHARED_SETTINGS)); |
@@ -97,6 +97,7 @@ class SupervisedUserSharedSettingsServiceTest : public ::testing::Test { |
new SyncChangeProcessorWrapperForTest(sync_processor_.get())), |
std::move(error_handler)); |
EXPECT_FALSE(result.error().IsSet()); |
+ return result; |
} |
const base::DictionaryValue* GetAllSettings() { |
@@ -190,7 +191,12 @@ TEST_F(SupervisedUserSharedSettingsServiceTest, SetAndGet) { |
TEST_F(SupervisedUserSharedSettingsServiceTest, Merge) { |
// Set initial values, then stop syncing so we can restart. |
- StartSyncing(SyncDataList()); |
+ SyncMergeResult result = StartSyncing(SyncDataList()); |
+ EXPECT_EQ(0, result.num_items_added()); |
+ EXPECT_EQ(0, result.num_items_deleted()); |
+ EXPECT_EQ(0, result.num_items_modified()); |
+ EXPECT_EQ(0, result.num_items_before_association()); |
+ EXPECT_EQ(0, result.num_items_after_association()); |
const char kIdA[] = "aaaaaa"; |
const char kIdB[] = "bbbbbb"; |
@@ -214,7 +220,14 @@ TEST_F(SupervisedUserSharedSettingsServiceTest, Merge) { |
SupervisedUserSharedSettingsService::CreateSyncDataForSetting( |
kIdC, "baz", blurp, true)); |
- StartSyncing(sync_data); |
+ result = StartSyncing(sync_data); |
+ |
+ EXPECT_EQ(1, result.num_items_added()); |
+ EXPECT_EQ(0, result.num_items_deleted()); |
+ EXPECT_EQ(1, result.num_items_modified()); |
+ EXPECT_EQ(3, result.num_items_before_association()); |
+ EXPECT_EQ(4, result.num_items_after_association()); |
+ |
EXPECT_EQ(2u, sync_processor_->changes().size()); |
VerifySyncChangesAndClear(); |
EXPECT_EQ(2u, changed_settings_.size()); |