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

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

Issue 2948963002: Prefer 192x192 icons from Web Manifests instead of 144x144 (Closed)
Patch Set: Addressed comments. Created 3 years, 6 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 be6a075c14062795b666e0d8257682ce75132201..bd7be8f08b23ae91c54434973840c2a51e706603 100644
--- a/components/favicon/core/favicon_handler_unittest.cc
+++ b/components/favicon/core/favicon_handler_unittest.cc
@@ -1567,6 +1567,30 @@ TEST_F(FaviconHandlerManifestsEnabledTest, GetFaviconFromUnknownManifest) {
EXPECT_THAT(delegate_.downloads(), ElementsAre(kManifestURL, kIconURL16x16));
}
+// Test that icons from a web manifest use a desired size of 192x192.
+TEST_F(FaviconHandlerManifestsEnabledTest, Prefer192x192IconFromManifest) {
+ const GURL kIconURL144x144 = GURL("http://www.google.com/favicon144x144");
+ const GURL kIconURL192x192 = GURL("http://www.google.com/favicon192x192");
+
+ delegate_.fake_image_downloader().Add(kIconURL144x144, IntVector{144});
+ delegate_.fake_image_downloader().Add(kIconURL192x192, IntVector{192});
+
+ const std::vector<favicon::FaviconURL> kManifestIcons = {
+ FaviconURL(kIconURL144x144, WEB_MANIFEST_ICON,
+ SizeVector(1U, gfx::Size(144, 144))),
+ FaviconURL(kIconURL192x192, WEB_MANIFEST_ICON,
+ SizeVector(1U, gfx::Size(192, 192))),
+ };
+
+ delegate_.fake_manifest_downloader().Add(kManifestURL, kManifestIcons);
+
+ RunHandlerWithCandidates(FaviconDriverObserver::TOUCH_LARGEST,
+ std::vector<favicon::FaviconURL>(), kManifestURL);
+
+ EXPECT_THAT(delegate_.downloads(),
+ ElementsAre(kManifestURL, kIconURL192x192));
+}
+
// Test that the manifest and icon are redownloaded if the icon cached for the
// page URL expired.
TEST_F(FaviconHandlerManifestsEnabledTest, GetFaviconFromExpiredManifest) {
« 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