Commit 7d249eef authored by Filip Gorski's avatar Filip Gorski Committed by Commit Bot

[Zine|Feed] Update default referrer URL

Changes the referrer value to:
* https://www.googleapis.com/auth/chrome-content-suggestions for
  NTP Article Suggestions

Bug: 903013
Change-Id: I62460e45d6134058d49c220c580e8a2f7834365d
Reviewed-on: https://chromium-review.googlesource.com/c/1325214Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611126}
parent 80462a16
...@@ -39,7 +39,7 @@ public final class SuggestionsConfig { ...@@ -39,7 +39,7 @@ public final class SuggestionsConfig {
* It must be kept in sync with //components/ntp_suggestions/features.cc * It must be kept in sync with //components/ntp_suggestions/features.cc
*/ */
private static final String DEFAULT_CONTENT_SUGGESTIONS_REFERRER_URL = private static final String DEFAULT_CONTENT_SUGGESTIONS_REFERRER_URL =
"https://discover.google.com/"; "https://www.googleapis.com/auth/chrome-content-suggestions";
/** Default value of referrer URL for contextual suggestions. */ /** Default value of referrer URL for contextual suggestions. */
private static final String DEFAULT_CONTEXTUAL_SUGGESTIONS_REFERRER_URL = private static final String DEFAULT_CONTEXTUAL_SUGGESTIONS_REFERRER_URL =
......
...@@ -160,7 +160,8 @@ std::vector<const base::Feature*> GetAllFeatures() { ...@@ -160,7 +160,8 @@ std::vector<const base::Feature*> GetAllFeatures() {
} }
// Default referrer for the content suggestions. // Default referrer for the content suggestions.
const char kDefaultReferrerUrl[] = "https://discover.google.com/"; const char kDefaultReferrerUrl[] =
"https://www.googleapis.com/auth/chrome-content-suggestions";
// Provides ability to customize the referrer URL. // Provides ability to customize the referrer URL.
// When specifying a referrer through a field trial, it must contain a path. // When specifying a referrer through a field trial, it must contain a path.
......
...@@ -14,29 +14,29 @@ ...@@ -14,29 +14,29 @@
namespace ntp_snippets { namespace ntp_snippets {
namespace { namespace {
const char kTestFeedURL[] = "https://test.google.com/"; const char kExpectedZineURL[] =
"https://www.googleapis.com/auth/chrome-content-suggestions";
const char kTestZineURL[] = "https://test.google.com/";
} // namespace } // namespace
TEST(FeaturesTest, GetContentSuggestionsReferrerURL_DefaultValue) { TEST(FeaturesTest, GetContentSuggestionsReferrerURL_DefaultValue) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(kArticleSuggestionsFeature); feature_list.InitAndEnableFeature(kArticleSuggestionsFeature);
EXPECT_EQ("https://discover.google.com/", GetContentSuggestionsReferrerURL()); EXPECT_EQ(kExpectedZineURL, GetContentSuggestionsReferrerURL());
// In code this will be often used inside of a GURL. // In code this will be often used inside of a GURL.
EXPECT_EQ("https://discover.google.com/", EXPECT_EQ(kExpectedZineURL, GURL(GetContentSuggestionsReferrerURL()));
GURL(GetContentSuggestionsReferrerURL())); EXPECT_EQ(kExpectedZineURL, GURL(GetContentSuggestionsReferrerURL()).spec());
EXPECT_EQ("https://discover.google.com/",
GURL(GetContentSuggestionsReferrerURL()).spec());
} }
TEST(FeaturesTest, GetContentSuggestionsReferrerURL_ParamValue) { TEST(FeaturesTest, GetContentSuggestionsReferrerURL_ParamValue) {
base::test::ScopedFeatureList feature_list; base::test::ScopedFeatureList feature_list;
std::map<std::string, std::string> parameters; std::map<std::string, std::string> parameters;
parameters["referrer_url"] = kTestFeedURL; parameters["referrer_url"] = kTestZineURL;
feature_list.InitAndEnableFeatureWithParameters(kArticleSuggestionsFeature, feature_list.InitAndEnableFeatureWithParameters(kArticleSuggestionsFeature,
parameters); parameters);
EXPECT_EQ(kTestFeedURL, GetContentSuggestionsReferrerURL()); EXPECT_EQ(kTestZineURL, GetContentSuggestionsReferrerURL());
} }
} // namespace ntp_snippets } // namespace ntp_snippets
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment