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

Unified Diff: chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc

Issue 1530763004: Add Statistics for SupervisedUserSettingService during merging and syncing data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698