Commit 6308aac2 authored by Filip Gorski's avatar Filip Gorski Committed by Commit Bot

[Favicons] Updating the parameters sent to favicon service V2

This is an update per request from the favicon service owners.

Bug: 870583
Change-Id: I93b466ee704ac0eb3b0c2d90b5ba40c639b89a55
Reviewed-on: https://chromium-review.googlesource.com/1163836Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581661}
parent bdaf1588
...@@ -48,8 +48,7 @@ const base::Feature kLargeIconServiceFetchingFeature{ ...@@ -48,8 +48,7 @@ const base::Feature kLargeIconServiceFetchingFeature{
"LargeIconServiceFetching", base::FEATURE_ENABLED_BY_DEFAULT}; "LargeIconServiceFetching", base::FEATURE_ENABLED_BY_DEFAULT};
const char kGoogleServerV2RequestFormat[] = const char kGoogleServerV2RequestFormat[] =
"https://t0.gstatic.com/faviconV2?" "https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2&%s"
"client=chrome&drop_404_icon=true&%s"
"size=%d&min_size=%d&max_size=%d&fallback_opts=TYPE,SIZE,URL&url=%s"; "size=%d&min_size=%d&max_size=%d&fallback_opts=TYPE,SIZE,URL&url=%s";
const char kGoogleServerV2RequestFormatParam[] = "request_format"; const char kGoogleServerV2RequestFormatParam[] = "request_format";
......
...@@ -149,7 +149,7 @@ class LargeIconServiceTest : public testing::Test { ...@@ -149,7 +149,7 @@ class LargeIconServiceTest : public testing::Test {
TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServer) { TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServer) {
const GURL kExpectedServerUrl( const GURL kExpectedServerUrl(
"https://t0.gstatic.com/faviconV2?client=chrome&drop_404_icon=true" "https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2"
"&check_seen=true&size=61&min_size=42&max_size=256" "&check_seen=true&size=61&min_size=42&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"); "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/");
...@@ -188,7 +188,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServer) { ...@@ -188,7 +188,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServer) {
TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerForDesktop) { TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerForDesktop) {
const GURL kExpectedServerUrl( const GURL kExpectedServerUrl(
"https://t0.gstatic.com/faviconV2?client=chrome_desktop" "https://t0.gstatic.com/faviconV2?client=chrome_desktop"
"&drop_404_icon=true&check_seen=true&size=32&min_size=32&max_size=256" "&nfrp=2&check_seen=true&size=32&min_size=32&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"); "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/");
EXPECT_CALL(mock_favicon_service_, UnableToDownloadFavicon(_)).Times(0); EXPECT_CALL(mock_favicon_service_, UnableToDownloadFavicon(_)).Times(0);
...@@ -266,7 +266,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithCustomUrl) { ...@@ -266,7 +266,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithCustomUrl) {
TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithOriginalUrl) { TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithOriginalUrl) {
const GURL kExpectedServerUrl( const GURL kExpectedServerUrl(
"https://t0.gstatic.com/faviconV2?client=chrome&drop_404_icon=true" "https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2"
"&check_seen=true&size=61&min_size=42&max_size=256" "&check_seen=true&size=61&min_size=42&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"); "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/");
const GURL kExpectedOriginalUrl("http://www.example.com/favicon.png"); const GURL kExpectedOriginalUrl("http://www.example.com/favicon.png");
...@@ -307,7 +307,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithOriginalUrl) { ...@@ -307,7 +307,7 @@ TEST_F(LargeIconServiceTest, ShouldGetFromGoogleServerWithOriginalUrl) {
TEST_F(LargeIconServiceTest, ShouldTrimQueryParametersForGoogleServer) { TEST_F(LargeIconServiceTest, ShouldTrimQueryParametersForGoogleServer) {
const GURL kDummyUrlWithQuery("http://www.example.com?foo=1"); const GURL kDummyUrlWithQuery("http://www.example.com?foo=1");
const GURL kExpectedServerUrl( const GURL kExpectedServerUrl(
"https://t0.gstatic.com/faviconV2?client=chrome&drop_404_icon=true" "https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2"
"&check_seen=true&size=61&min_size=42&max_size=256" "&check_seen=true&size=61&min_size=42&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"); "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/");
...@@ -414,7 +414,7 @@ TEST_F(LargeIconServiceTest, ShouldNotQueryGoogleServerIfInvalidURL) { ...@@ -414,7 +414,7 @@ TEST_F(LargeIconServiceTest, ShouldNotQueryGoogleServerIfInvalidURL) {
TEST_F(LargeIconServiceTest, ShouldReportUnavailableIfFetchFromServerFails) { TEST_F(LargeIconServiceTest, ShouldReportUnavailableIfFetchFromServerFails) {
const GURL kExpectedServerUrl( const GURL kExpectedServerUrl(
"https://t0.gstatic.com/faviconV2?client=chrome&drop_404_icon=true" "https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2"
"&check_seen=true&size=61&min_size=42&max_size=256" "&check_seen=true&size=61&min_size=42&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"); "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/");
...@@ -450,10 +450,9 @@ TEST_F(LargeIconServiceTest, ShouldReportUnavailableIfFetchFromServerFails) { ...@@ -450,10 +450,9 @@ TEST_F(LargeIconServiceTest, ShouldReportUnavailableIfFetchFromServerFails) {
} }
TEST_F(LargeIconServiceTest, ShouldNotGetFromGoogleServerIfUnavailable) { TEST_F(LargeIconServiceTest, ShouldNotGetFromGoogleServerIfUnavailable) {
ON_CALL( ON_CALL(mock_favicon_service_,
mock_favicon_service_, WasUnableToDownloadFavicon(
WasUnableToDownloadFavicon(GURL( GURL("https://t0.gstatic.com/faviconV2?client=chrome&nfrp=2"
"https://t0.gstatic.com/faviconV2?client=chrome&drop_404_icon=true"
"&check_seen=true&size=61&min_size=42&max_size=256" "&check_seen=true&size=61&min_size=42&max_size=256"
"&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/"))) "&fallback_opts=TYPE,SIZE,URL&url=http://www.example.com/")))
.WillByDefault(Return(true)); .WillByDefault(Return(true));
......
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