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

Unified Diff: chrome/test/base/testing_profile_manager.cc

Issue 845373002: Change default code flag to NewAvatarMenu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky@ comments; shess@ nit Created 5 years, 9 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: chrome/test/base/testing_profile_manager.cc
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc
index ce2cf195f83dccd163005ece4605b9df85f269f3..6b0df50a64c757291c30c8e3f965ce723a7d6e4a 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -4,9 +4,12 @@
#include "chrome/test/base/testing_profile_manager.h"
+#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
+#include "chrome/browser/profiles/profile_avatar_downloader.h"
+#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_constants.h"
@@ -97,6 +100,18 @@ TestingProfile* TestingProfileManager::CreateTestingProfile(
size_t index = cache.GetIndexOfProfileWithPath(profile_path);
cache.SetAvatarIconOfProfileAtIndex(index, avatar_id);
cache.SetSupervisedUserIdOfProfileAtIndex(index, supervised_user_id);
+
+ // Cache a "high res" icon so we don't try to fetch one over the network.
+ ProfileAvatarDownloader avatar_downloader(
noms (inactive) 2015/03/09 19:26:17 nit: same question as before. Doesn't this run on
Mike Lerman 2015/03/10 15:58:59 Same answer as before. The ProfileAvatarDownloader
+ cache.GetAvatarIconIndexOfProfileAtIndex(index), profile_path, &cache);
+
+ // Put a real bitmap into "bitmap". 2x2 bitmap of green 32 bit pixels.
+ SkBitmap bitmap;
+ bitmap.allocN32Pixels(2, 2);
+ bitmap.eraseColor(SK_ColorGREEN);
+ avatar_downloader.OnFetchComplete(
+ GURL("http://www.google.com/avatar.png"), &bitmap);
+
// SetNameOfProfileAtIndex may reshuffle the list of profiles, so we do it
// last.
cache.SetNameOfProfileAtIndex(index, user_name);

Powered by Google App Engine
This is Rietveld 408576698