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..09c536d167d8f9aaa8c8f4fc5b64138b27cd9c8b 100644 |
--- a/components/favicon/core/favicon_handler_unittest.cc |
+++ b/components/favicon/core/favicon_handler_unittest.cc |
@@ -1567,6 +1567,36 @@ TEST_F(FaviconHandlerManifestsEnabledTest, GetFaviconFromUnknownManifest) { |
EXPECT_THAT(delegate_.downloads(), ElementsAre(kManifestURL, kIconURL16x16)); |
} |
+// Test that a favicon corresponding to a web manifest is reported when there is |
+// data in the database for neither the page URL nor the manifest URL. |
pkotwicz
2017/06/21 18:03:43
The comment seems to be unrelated to the test
mastiz
2017/06/23 10:29:36
Done, thanks for catching.
|
+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, |
+ { |
+ FaviconURL(kIconURL12x12, TOUCH_ICON, kEmptySizes), |
+ FaviconURL(kIconURL64x64, TOUCH_ICON, kEmptySizes), |
+ }, |
pkotwicz
2017/06/21 18:03:43
Can the |candidates| be empty?
mastiz
2017/06/23 10:29:36
Done.
|
+ 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) { |