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 {
* It must be kept in sync with //components/ntp_suggestions/features.cc
*/
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. */
private static final String DEFAULT_CONTEXTUAL_SUGGESTIONS_REFERRER_URL =
......
......@@ -160,7 +160,8 @@ std::vector<const base::Feature*> GetAllFeatures() {
}
// 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.
// When specifying a referrer through a field trial, it must contain a path.
......
......@@ -14,29 +14,29 @@
namespace ntp_snippets {
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
TEST(FeaturesTest, GetContentSuggestionsReferrerURL_DefaultValue) {
base::test::ScopedFeatureList feature_list;
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.
EXPECT_EQ("https://discover.google.com/",
GURL(GetContentSuggestionsReferrerURL()));
EXPECT_EQ("https://discover.google.com/",
GURL(GetContentSuggestionsReferrerURL()).spec());
EXPECT_EQ(kExpectedZineURL, GURL(GetContentSuggestionsReferrerURL()));
EXPECT_EQ(kExpectedZineURL, GURL(GetContentSuggestionsReferrerURL()).spec());
}
TEST(FeaturesTest, GetContentSuggestionsReferrerURL_ParamValue) {
base::test::ScopedFeatureList feature_list;
std::map<std::string, std::string> parameters;
parameters["referrer_url"] = kTestFeedURL;
parameters["referrer_url"] = kTestZineURL;
feature_list.InitAndEnableFeatureWithParameters(kArticleSuggestionsFeature,
parameters);
EXPECT_EQ(kTestFeedURL, GetContentSuggestionsReferrerURL());
EXPECT_EQ(kTestZineURL, GetContentSuggestionsReferrerURL());
}
} // 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