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

Unified Diff: components/suggestions/suggestions_service_unittest.cc

Issue 1314493013: Popular sites on the NTP: add thumbnails! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android_clang_dbg_recipe build Created 5 years, 3 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/suggestions/suggestions_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/suggestions_service_unittest.cc
diff --git a/components/suggestions/suggestions_service_unittest.cc b/components/suggestions/suggestions_service_unittest.cc
index 355450c96f1a56a2605e2592344fb2554108162c..622e64bc11369f4665ec9d0225dc6befb2e23599 100644
--- a/components/suggestions/suggestions_service_unittest.cc
+++ b/components/suggestions/suggestions_service_unittest.cc
@@ -135,6 +135,7 @@ class MockImageManager : public suggestions::ImageManager {
MOCK_METHOD2(GetImageForURL,
void(const GURL&,
base::Callback<void(const GURL&, const SkBitmap*)>));
+ MOCK_METHOD2(AddImageURL, void(const GURL&, const GURL&));
};
class MockBlacklistStore : public suggestions::BlacklistStore {
@@ -632,4 +633,24 @@ TEST_F(SuggestionsServiceTest, CheckDefaultTimeStamps) {
EXPECT_EQ(kTestSetExpiry, suggestions.suggestions(0).expiry_ts());
EXPECT_EQ(kTestDefaultExpiry, suggestions.suggestions(1).expiry_ts());
}
+
+TEST_F(SuggestionsServiceTest, GetPageThumbnail) {
+ scoped_ptr<SuggestionsService> suggestions_service(
+ CreateSuggestionsServiceWithMocks());
+ ASSERT_TRUE(suggestions_service != NULL);
+
+ GURL test_url(kTestUrl);
+ GURL thumbnail_url("https://www.thumbnails.com/thumb.jpg");
+ base::Callback<void(const GURL&, const SkBitmap*)> dummy_callback;
+
+ EXPECT_CALL(*mock_thumbnail_manager_, GetImageForURL(test_url, _));
+ suggestions_service->GetPageThumbnail(test_url, dummy_callback);
+
+ EXPECT_CALL(*mock_thumbnail_manager_, AddImageURL(test_url, thumbnail_url));
+ EXPECT_CALL(*mock_thumbnail_manager_, GetImageForURL(test_url, _));
+ suggestions_service->GetPageThumbnailWithURL(test_url, thumbnail_url,
+ dummy_callback);
+
+}
+
} // namespace suggestions
« no previous file with comments | « components/suggestions/suggestions_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698