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

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

Issue 2665743002: [Remote suggestions] Clean up variation params in the fetcher. (Closed)
Patch Set: Remove an unused member Created 3 years, 10 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 84b83172c3c06ff8e2c1023bb16acc941e47b934..84349c862695b8acc838a367cc09420ede36a22a 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
@@ -32,6 +32,7 @@
#include "components/ntp_snippets/category_rankers/constant_category_ranker.h"
#include "components/ntp_snippets/category_rankers/mock_category_ranker.h"
#include "components/ntp_snippets/fake_content_suggestions_provider_observer.h"
+#include "components/ntp_snippets/features.h"
#include "components/ntp_snippets/ntp_snippets_constants.h"
#include "components/ntp_snippets/pref_names.h"
#include "components/ntp_snippets/remote/persistent_scheduler.h"
@@ -91,11 +92,11 @@ MATCHER_P(HasCode, code, "") {
const base::Time::Exploded kDefaultCreationTime = {2015, 11, 4, 25, 13, 46, 45};
const char kTestContentSuggestionsServerEndpoint[] =
- "https://localunittest-chromecontentsuggestions-pa.googleapis.com/v1/"
+ "https://alpha-chromecontentsuggestions-pa.sandbox.googleapis.com/v1/"
"suggestions/fetch";
const char kAPIKey[] = "fakeAPIkey";
const char kTestContentSuggestionsServerWithAPIKey[] =
- "https://localunittest-chromecontentsuggestions-pa.googleapis.com/v1/"
+ "https://alpha-chromecontentsuggestions-pa.sandbox.googleapis.com/v1/"
"suggestions/fetch?key=fakeAPIkey";
const char kSuggestionUrl[] = "http://localhost/foobar";
@@ -368,8 +369,8 @@ class RemoteSuggestionsProviderImplTest : public ::testing::Test {
RemoteSuggestionsProviderImplTest()
: params_manager_(ntp_snippets::kStudyName,
{{"content_suggestions_backend",
- kTestContentSuggestionsServerEndpoint},
- {"fetching_personalization", "non_personal"}}),
+ kTestContentSuggestionsServerEndpoint}},
+ {ntp_snippets::kArticleSuggestionsFeature.name}),
fake_url_fetcher_factory_(
/*default_factory=*/&failing_url_fetcher_factory_),
test_url_(kTestContentSuggestionsServerWithAPIKey),
@@ -411,13 +412,11 @@ class RemoteSuggestionsProviderImplTest : public ::testing::Test {
utils_.ResetSigninManager();
auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcher>(
- utils_.fake_signin_manager(), fake_token_service_.get(),
+ utils_.fake_signin_manager(), /*token_service=*/nullptr,
Marc Treib 2017/02/03 10:52:08 Does this work without any "may be null in tests"
jkrcal 2017/02/03 11:04:16 I think the tests belong to the fetcher_unittest.
Marc Treib 2017/02/03 11:10:46 That makes sense! We have a separate TODO on the F
std::move(request_context_getter), utils_.pref_service(), nullptr,
base::Bind(&ParseJson), kAPIKey, &user_classifier_);
suggestions_fetcher_ = suggestions_fetcher.get();
- utils_.fake_signin_manager()->SignIn("foo@bar.com");
-
auto image_fetcher = base::MakeUnique<NiceMock<MockImageFetcher>>();
image_fetcher_ = image_fetcher.get();
@@ -539,7 +538,6 @@ class RemoteSuggestionsProviderImplTest : public ::testing::Test {
// Instantiation of factory automatically sets itself as URLFetcher's factory.
net::FakeURLFetcherFactory fake_url_fetcher_factory_;
const GURL test_url_;
- std::unique_ptr<OAuth2TokenService> fake_token_service_;
std::unique_ptr<CategoryRanker> category_ranker_;
UserClassifier user_classifier_;
std::unique_ptr<FakeContentSuggestionsProviderObserver> observer_;
« no previous file with comments | « components/ntp_snippets/remote/remote_suggestions_fetcher_unittest.cc ('k') | components/ntp_snippets/remote/request_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698