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

Unified Diff: components/ntp_snippets/ntp_snippets_test_utils.cc

Issue 2285133004: Overhaul ntp_snippets_service_unittest.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 4 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
Index: components/ntp_snippets/ntp_snippets_test_utils.cc
diff --git a/components/ntp_snippets/ntp_snippets_test_utils.cc b/components/ntp_snippets/ntp_snippets_test_utils.cc
index d20b7afb341d37ce98cdfba4ddcb5863ff643c3a..c26ce93028e762a1546b5ed92fb1ea08a2682a1c 100644
--- a/components/ntp_snippets/ntp_snippets_test_utils.cc
+++ b/components/ntp_snippets/ntp_snippets_test_utils.cc
@@ -17,36 +17,36 @@
namespace ntp_snippets {
namespace test {
-MockSyncService::MockSyncService()
+FakeSyncService::FakeSyncService()
: can_sync_start_(true),
is_sync_active_(true),
configuration_done_(true),
is_encrypt_everything_enabled_(false),
active_data_types_(syncer::HISTORY_DELETE_DIRECTIVES) {}
-MockSyncService::~MockSyncService() {}
+FakeSyncService::~FakeSyncService() {}
-bool MockSyncService::CanSyncStart() const {
+bool FakeSyncService::CanSyncStart() const {
return can_sync_start_;
}
-bool MockSyncService::IsSyncActive() const {
+bool FakeSyncService::IsSyncActive() const {
return is_sync_active_;
}
-bool MockSyncService::ConfigurationDone() const {
+bool FakeSyncService::ConfigurationDone() const {
return configuration_done_;
}
-bool MockSyncService::IsEncryptEverythingEnabled() const {
+bool FakeSyncService::IsEncryptEverythingEnabled() const {
return is_encrypt_everything_enabled_;
}
-syncer::ModelTypeSet MockSyncService::GetActiveDataTypes() const {
+syncer::ModelTypeSet FakeSyncService::GetActiveDataTypes() const {
return active_data_types_;
}
-NTPSnippetsTestBase::NTPSnippetsTestBase()
+NTPSnippetsTestUtils::NTPSnippetsTestUtils()
: pref_service_(new TestingPrefServiceSimple()) {
pref_service_->registry()->RegisterStringPref(prefs::kGoogleServicesAccountId,
std::string());
@@ -54,18 +54,15 @@ NTPSnippetsTestBase::NTPSnippetsTestBase()
prefs::kGoogleServicesLastAccountId, std::string());
pref_service_->registry()->RegisterStringPref(
prefs::kGoogleServicesLastUsername, std::string());
-}
-
-NTPSnippetsTestBase::~NTPSnippetsTestBase() {}
-
-void NTPSnippetsTestBase::SetUp() {
signin_client_.reset(new TestSigninClient(pref_service_.get()));
account_tracker_.reset(new AccountTrackerService());
- mock_sync_service_.reset(new MockSyncService());
+ fake_sync_service_.reset(new FakeSyncService());
ResetSigninManager();
}
-void NTPSnippetsTestBase::ResetSigninManager() {
+NTPSnippetsTestUtils::~NTPSnippetsTestUtils() = default;
+
+void NTPSnippetsTestUtils::ResetSigninManager() {
fake_signin_manager_.reset(
new FakeSigninManagerBase(signin_client_.get(), account_tracker_.get()));
}

Powered by Google App Engine
This is Rietveld 408576698