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

Unified Diff: components/suggestions/image_manager_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/image_manager.cc ('k') | components/suggestions/suggestions_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/image_manager_unittest.cc
diff --git a/components/suggestions/image_manager_unittest.cc b/components/suggestions/image_manager_unittest.cc
index c52b54cee8001632cdd28690e5b7b58fa7bb6edc..1c797ad9f6b07360a67d2b5258343bfb3b02129a 100644
--- a/components/suggestions/image_manager_unittest.cc
+++ b/components/suggestions/image_manager_unittest.cc
@@ -149,6 +149,19 @@ TEST_F(ImageManagerTest, InitializeTest) {
EXPECT_FALSE(image_manager_->GetImageURL(GURL("http://b.com"), &output));
}
+TEST_F(ImageManagerTest, AddImageURL) {
+ InitializeDefaultImageMapAndDatabase(image_manager_.get(), fake_db_);
+
+ GURL output;
+ // Try a URL the ImageManager doesn't know about.
+ ASSERT_FALSE(image_manager_->GetImageURL(GURL(kTestUrl2), &output));
+
+ // Explicitly add the URL and try again.
+ image_manager_->AddImageURL(GURL(kTestUrl2), GURL(kTestImagePath));
+ EXPECT_TRUE(image_manager_->GetImageURL(GURL(kTestUrl2), &output));
+ EXPECT_EQ(GURL(kTestImagePath), output);
+}
+
TEST_F(ImageManagerTest, GetImageForURLNetwork) {
InitializeDefaultImageMapAndDatabase(image_manager_.get(), fake_db_);
« no previous file with comments | « components/suggestions/image_manager.cc ('k') | components/suggestions/suggestions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698