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 5a608b8ec5446bff4af2dfe69ff1338178c962a3..3962b2d2ad8b819d54b8015f906f53b7cb1c2e39 100644 |
--- a/components/favicon/core/favicon_handler_unittest.cc |
+++ b/components/favicon/core/favicon_handler_unittest.cc |
@@ -467,6 +467,21 @@ TEST_F(FaviconHandlerTest, DownloadUnknownFaviconInIncognito) { |
ElementsAre(kPageURL, kIconURL16x16)); |
} |
+// Test that the FaviconHandler saves a favicon if the page is bookmarked, even |
+// in incognito. |
+TEST_F(FaviconHandlerTest, DownloadBookmarkedFaviconInIncognito) { |
+ ON_CALL(delegate_, IsOffTheRecord()).WillByDefault(Return(true)); |
+ ON_CALL(delegate_, IsBookmarked(kPageURL)).WillByDefault(Return(true)); |
+ |
+ EXPECT_CALL(favicon_service_, UpdateFaviconMappingsAndFetch(_, _, _, _, _, _)) |
+ .Times(0); |
+ |
+ EXPECT_CALL(favicon_service_, SetFavicons(_, kIconURL16x16, _, _)); |
+ |
+ RunHandlerWithSimpleFaviconCandidates({kIconURL16x16}); |
+ EXPECT_THAT(delegate_.downloads(), ElementsAre(kIconURL16x16)); |
+} |
+ |
// Test that the icon is redownloaded if the icon cached for the page URL |
// expired. |
TEST_F(FaviconHandlerTest, RedownloadExpiredPageUrlFavicon) { |