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

Unified Diff: components/ntp_tiles/icon_cacher_impl_unittest.cc

Issue 2725293002: Handle null callbacks in OnFaviconDownloaded (Closed)
Patch Set: Address comments Created 3 years, 10 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/ntp_tiles/icon_cacher_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/icon_cacher_impl_unittest.cc
diff --git a/components/ntp_tiles/icon_cacher_impl_unittest.cc b/components/ntp_tiles/icon_cacher_impl_unittest.cc
index 721aa008f252e6f4006cdae6258aabc273ecbe03..bab8c30ed95bd9eb38df0efba956a4c735407fcd 100644
--- a/components/ntp_tiles/icon_cacher_impl_unittest.cc
+++ b/components/ntp_tiles/icon_cacher_impl_unittest.cc
@@ -275,6 +275,16 @@ TEST_F(IconCacherTest, LargeNotCachedAndFetchFailed) {
EXPECT_FALSE(IconIsCachedFor(site_.url, favicon_base::TOUCH_ICON));
}
+TEST_F(IconCacherTest, HandlesEmptyCallbacksNicely) {
+ EXPECT_CALL(*image_fetcher_, SetDataUseServiceName(_));
+ EXPECT_CALL(*image_fetcher_, SetDesiredImageFrameSize(_));
+ ON_CALL(*image_fetcher_, StartOrQueueNetworkRequest(_, _, _))
+ .WillByDefault(PassFetch(128, 128));
+ IconCacherImpl cacher(&favicon_service_, std::move(image_fetcher_));
+ cacher.StartFetch(site_, base::Closure(), base::Closure());
+ WaitForTasksToFinish();
+}
+
TEST_F(IconCacherTest, ProvidesDefaultIconAndSucceedsWithFetching) {
// We are not interested which delegate function actually handles the call to
// |GetNativeImageNamed| as long as we receive the right image.
« no previous file with comments | « components/ntp_tiles/icon_cacher_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698