From 448721c3b2da4e84f1b772cd2b027b658bf9ace3 Mon Sep 17 00:00:00 2001 From: "noms@chromium.org" Date: Tue, 19 Aug 2014 14:49:40 +0000 Subject: Merge 289964 "[Profiles] Downloading high res avatars should do ..." > [Profiles] Downloading high res avatars should do nothing on non-desktop > > BUG=404066 > > Review URL: https://codereview.chromium.org/476133002 TBR=noms@chromium.org Review URL: https://codereview.chromium.org/483303003 git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@290553 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/profiles/profile_info_cache.cc | 5 +++++ chrome/browser/profiles/profile_info_cache_unittest.cc | 3 +++ 2 files changed, 8 insertions(+) diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc index a6f8d9a..3a49fc0 100644 --- a/chrome/browser/profiles/profile_info_cache.cc +++ b/chrome/browser/profiles/profile_info_cache.cc @@ -793,6 +793,11 @@ void ProfileInfoCache::RegisterPrefs(PrefRegistrySimple* registry) { void ProfileInfoCache::DownloadHighResAvatar( size_t icon_index, const base::FilePath& profile_path) { + // Downloading is only supported on desktop. +#if defined(OS_ANDROID) || defined(OS_IOS) || defined(OS_CHROMEOS) + return; +#endif + // TODO(noms): We should check whether the file already exists on disk // before trying to re-download it. For now, since this is behind a flag and // the resources are still changing, re-download it every time the profile diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc index 92638ae..11a682e 100644 --- a/chrome/browser/profiles/profile_info_cache_unittest.cc +++ b/chrome/browser/profiles/profile_info_cache_unittest.cc @@ -504,6 +504,8 @@ TEST_F(ProfileInfoCacheTest, AddStubProfile) { ASSERT_FALSE(names[i].empty()); } +// High res avatar downloading is only supported on desktop. +#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) TEST_F(ProfileInfoCacheTest, DownloadHighResAvatarTest) { EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles()); base::FilePath path_1 = GetProfilePath("path_1"); @@ -551,3 +553,4 @@ TEST_F(ProfileInfoCacheTest, DownloadHighResAvatarTest) { EXPECT_TRUE(base::DeleteFile(icon_path, true)); EXPECT_FALSE(base::PathExists(icon_path)); } +#endif -- cgit v1.1