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

Unified Diff: components/favicon/core/favicon_handler_unittest.cc

Issue 2972643002: Always prefer 192x192 on mobile, also for touch icons (Closed)
Patch Set: Removed comment. Created 3 years, 5 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
« no previous file with comments | « components/favicon/core/favicon_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/favicon/core/favicon_handler_unittest.cc
diff --git a/components/favicon/core/favicon_handler_unittest.cc b/components/favicon/core/favicon_handler_unittest.cc
index ee396b9dd978e40b22095b132008116c1ede850f..9997cd6ae21cbc9c9b2be9af83ba0bb4cd494eb1 100644
--- a/components/favicon/core/favicon_handler_unittest.cc
+++ b/components/favicon/core/favicon_handler_unittest.cc
@@ -1210,6 +1210,27 @@ TEST_F(FaviconHandlerTest, TestSortFavicon) {
kIconURLWithoutSize1, kIconURLWithoutSize2));
}
+TEST_F(FaviconHandlerTest, TestSortTouchIconLargest) {
+ const GURL kIconURLWithoutSize("http://www.google.com/touchicon-nosize");
+ const GURL kIconURL144x144("http://www.google.com/touchicon144x144");
+ const GURL kIconURL192x192("http://www.google.com/touchicon192x192");
+
+ const std::vector<favicon::FaviconURL> kSourceIconURLs{
+ FaviconURL(kIconURLWithoutSize, TOUCH_ICON, kEmptySizes),
+ FaviconURL(kIconURL144x144, TOUCH_ICON,
+ SizeVector(1U, gfx::Size(144, 144))),
+ FaviconURL(kIconURL192x192, TOUCH_ICON,
+ SizeVector(1U, gfx::Size(192, 192))),
+ };
+
+ std::unique_ptr<FaviconHandler> handler = RunHandlerWithCandidates(
+ FaviconDriverObserver::TOUCH_LARGEST, kSourceIconURLs);
+
+ EXPECT_THAT(
+ handler->GetIconURLs(),
+ ElementsAre(kIconURL192x192, kIconURL144x144, kIconURLWithoutSize));
+}
+
TEST_F(FaviconHandlerTest, TestDownloadLargestFavicon) {
// Names represent the bitmap sizes per icon.
const GURL kIconURL1024_512("http://www.google.com/a");
« no previous file with comments | « components/favicon/core/favicon_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698