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

Unified Diff: chrome/browser/profiles/profile_info_cache_unittest.cc

Issue 1127113003: Don't try to download 'NothingToDownload' placeholder avatar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify the comments a bit. Created 5 years, 7 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 | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache_unittest.cc
diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc
index 67055fbe8d687d2119cb9b7b0ce3c12e9f99cdee..87c7a24fcbd1a9da6b68ab2fbc2c7ebdf5d17286 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -614,6 +614,31 @@ TEST_F(ProfileInfoCacheTest, DownloadHighResAvatarTest) {
EXPECT_FALSE(base::PathExists(icon_path));
}
+TEST_F(ProfileInfoCacheTest, NothingToDownloadHighResAvatarTest) {
+ switches::EnableNewAvatarMenuForTesting(
+ base::CommandLine::ForCurrentProcess());
+
+ // The TestingProfileManager's ProfileInfoCache doesn't download avatars.
+ ProfileInfoCache profile_info_cache(
+ g_browser_process->local_state(),
+ testing_profile_manager_.profile_manager()->user_data_dir());
+
+ const size_t kIconIndex = profiles::GetPlaceholderAvatarIndex();
+
+ EXPECT_EQ(0U, profile_info_cache.GetNumberOfProfiles());
+ base::FilePath path_1 = GetProfilePath("path_1");
+ profile_info_cache.AddProfileToCache(path_1, ASCIIToUTF16("name_1"),
+ std::string(), base::string16(),
+ kIconIndex, std::string());
+ EXPECT_EQ(1U, profile_info_cache.GetNumberOfProfiles());
+ base::RunLoop().RunUntilIdle();
+
+ // We haven't tried to download any high-res avatars as the specified icon is
+ // just a placeholder.
+ EXPECT_EQ(0U, profile_info_cache.cached_avatar_images_.size());
+ EXPECT_EQ(0U, profile_info_cache.avatar_images_downloads_in_progress_.size());
+}
+
TEST_F(ProfileInfoCacheTest, MigrateLegacyProfileNamesWithNewAvatarMenu) {
switches::EnableNewAvatarMenuForTesting(
base::CommandLine::ForCurrentProcess());
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698