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

Unified Diff: components/ntp_snippets/ntp_snippets_service_unittest.cc

Issue 2158373002: [NTP Snippets] Add a pref to disable the NTPSnippetsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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_service_unittest.cc
diff --git a/components/ntp_snippets/ntp_snippets_service_unittest.cc b/components/ntp_snippets/ntp_snippets_service_unittest.cc
index 9a7dad096636667e16452954a98a10ef475cf0c9..b5019c9c19373b90d379403fe53027f28ee8e32f 100644
--- a/components/ntp_snippets/ntp_snippets_service_unittest.cc
+++ b/components/ntp_snippets/ntp_snippets_service_unittest.cc
@@ -327,8 +327,8 @@ class NTPSnippetsServiceTest : public test::NTPSnippetsTestBase {
std::move(snippets_fetcher), /*image_fetcher=*/nullptr,
/*image_fetcher=*/nullptr, base::MakeUnique<NTPSnippetsDatabase>(
database_dir_.path(), task_runner),
- base::MakeUnique<NTPSnippetsStatusService>(fake_signin_manager(),
- mock_sync_service())));
+ base::MakeUnique<NTPSnippetsStatusService>(
+ fake_signin_manager(), mock_sync_service(), pref_service())));
if (enabled)
WaitForDBLoad(service_.get());
@@ -868,7 +868,7 @@ TEST_F(NTPSnippetsServiceTest, HistorySyncStateChanges) {
SetUpFetchResponse(GetTestJson({GetSnippet()}));
EXPECT_CALL(mock_observer, NTPSnippetsServiceDisabledReasonChanged(
DisabledReason::SIGNED_OUT));
- service()->UpdateStateForStatus(DisabledReason::SIGNED_OUT);
+ service()->OnDisabledReasonChanged(DisabledReason::SIGNED_OUT);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(NTPSnippetsService::State::DISABLED, service()->state_);
EXPECT_THAT(service()->snippets(), IsEmpty()); // No fetch should be made.
@@ -878,7 +878,7 @@ TEST_F(NTPSnippetsServiceTest, HistorySyncStateChanges) {
EXPECT_CALL(mock_observer,
NTPSnippetsServiceDisabledReasonChanged(DisabledReason::NONE));
EXPECT_CALL(mock_scheduler(), Schedule(_, _, _, _)).Times(1);
- service()->UpdateStateForStatus(DisabledReason::NONE);
+ service()->OnDisabledReasonChanged(DisabledReason::NONE);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(NTPSnippetsService::State::READY, service()->state_);
EXPECT_FALSE(service()->snippets().empty());

Powered by Google App Engine
This is Rietveld 408576698