OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 #include "base/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/test/histogram_tester.h" | 8 #include "base/test/histogram_tester.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 type = syncer::PRIORITY_PREFERENCES; | 116 type = syncer::PRIORITY_PREFERENCES; |
117 ASSERT_NE(syncer::UNSPECIFIED, type) << "Wrong preference name: " << name; | 117 ASSERT_NE(syncer::UNSPECIFIED, type) << "Wrong preference name: " << name; |
118 syncer::SyncableService* sync = prefs->GetSyncableService(type); | 118 syncer::SyncableService* sync = prefs->GetSyncableService(type); |
119 sync->MergeDataAndStartSyncing(type, sync_data_list, | 119 sync->MergeDataAndStartSyncing(type, sync_data_list, |
120 std::unique_ptr<syncer::SyncChangeProcessor>( | 120 std::unique_ptr<syncer::SyncChangeProcessor>( |
121 new syncer::FakeSyncChangeProcessor), | 121 new syncer::FakeSyncChangeProcessor), |
122 std::unique_ptr<syncer::SyncErrorFactory>( | 122 std::unique_ptr<syncer::SyncErrorFactory>( |
123 new syncer::SyncErrorFactoryMock)); | 123 new syncer::SyncErrorFactoryMock)); |
124 } | 124 } |
125 | 125 |
126 class SyncServiceMock : public sync_driver::FakeSyncService { | 126 class SyncServiceMock : public syncer::FakeSyncService { |
127 public: | 127 public: |
128 bool IsFirstSetupComplete() const override { return true; } | 128 bool IsFirstSetupComplete() const override { return true; } |
129 | 129 |
130 bool CanSyncStart() const override { return can_sync_start_; } | 130 bool CanSyncStart() const override { return can_sync_start_; } |
131 | 131 |
132 void SetCanSyncStart(bool can_sync_start) { | 132 void SetCanSyncStart(bool can_sync_start) { |
133 can_sync_start_ = can_sync_start; | 133 can_sync_start_ = can_sync_start; |
134 } | 134 } |
135 | 135 |
136 private: | 136 private: |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); | 453 ASSERT_EQ(prefs()->GetBoolean(prefs::kCredentialsEnableService), true); |
454 profile_sync_service()->SetCanSyncStart(false); | 454 profile_sync_service()->SetCanSyncStart(false); |
455 base::HistogramTester tester; | 455 base::HistogramTester tester; |
456 NotifyProfileAdded(); | 456 NotifyProfileAdded(); |
457 ExpectValuesForBothPrefValues(true, true); | 457 ExpectValuesForBothPrefValues(true, true); |
458 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), | 458 EXPECT_THAT(tester.GetAllSamples(kInitialAndFinalValuesHistogramName), |
459 testing::ElementsAre(base::Bucket(I11F11, 1))); | 459 testing::ElementsAre(base::Bucket(I11F11, 1))); |
460 } | 460 } |
461 | 461 |
462 } // namespace password_manager | 462 } // namespace password_manager |
OLD | NEW |