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

Unified Diff: components/ntp_tiles/icon_cacher_impl_unittest.cc

Issue 2725293002: Handle null callbacks in OnFaviconDownloaded (Closed)
Patch Set: 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
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..da652774574af7cbe480f5f391786db01303ed89 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, HandlesEmptyClosuresNicely) {
Marc Treib 2017/03/03 10:29:42 nit: s/Closures/Callbacks/ ? (The fact that they h
fhorschig 2017/03/03 10:35:26 Done.
+ 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.
« components/ntp_tiles/icon_cacher_impl.cc ('K') | « 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