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

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

Issue 2804573002: Add FaviconHandler test reflecting behavior of bookmarks in incognito (Closed)
Patch Set: Verified downloads. Created 3 years, 8 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 | « no previous file | 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 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698