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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc

Issue 2667623002: [Remote suggestions] Clean up variation params in the status service (Closed)
Patch Set: Rebase Created 3 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
Index: components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
index e1a76e6e3e42acb303c3f1b270d288a79f8b5854..32c7a68a9cb176570f7a37f287a9afb347678e8f 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
@@ -1528,37 +1528,6 @@ TEST_F(RemoteSuggestionsProviderImplTest, DismissShouldRespectAllKnownUrls) {
IsEmpty());
}
-TEST_F(RemoteSuggestionsProviderImplTest, StatusChanges) {
- auto service = MakeSuggestionsProvider();
-
- // Simulate user signed out
- SetUpFetchResponse(GetTestJson({GetSuggestion()}));
- service->OnStatusChanged(RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN,
- RemoteSuggestionsStatus::SIGNED_OUT_AND_DISABLED);
-
- base::RunLoop().RunUntilIdle();
- EXPECT_THAT(observer().StatusForCategory(articles_category()),
- Eq(CategoryStatus::SIGNED_OUT));
- EXPECT_THAT(RemoteSuggestionsProviderImpl::State::DISABLED,
- Eq(service->state_));
- EXPECT_THAT(service->GetSuggestionsForTesting(articles_category()),
- IsEmpty()); // No fetch should be made.
-
- // Simulate user sign in. The service should be ready again and load
- // suggestions.
- SetUpFetchResponse(GetTestJson({GetSuggestion()}));
- service->OnStatusChanged(RemoteSuggestionsStatus::SIGNED_OUT_AND_DISABLED,
- RemoteSuggestionsStatus::ENABLED_AND_SIGNED_IN);
- EXPECT_THAT(observer().StatusForCategory(articles_category()),
- Eq(CategoryStatus::AVAILABLE_LOADING));
-
- base::RunLoop().RunUntilIdle();
- EXPECT_THAT(observer().StatusForCategory(articles_category()),
- Eq(CategoryStatus::AVAILABLE));
- EXPECT_THAT(RemoteSuggestionsProviderImpl::State::READY, Eq(service->state_));
- EXPECT_FALSE(service->GetSuggestionsForTesting(articles_category()).empty());
-}
-
TEST_F(RemoteSuggestionsProviderImplTest, ImageReturnedWithTheSameId) {
auto service = MakeSuggestionsProvider();

Powered by Google App Engine
This is Rietveld 408576698