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

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

Issue 9020013: Refactor ProfileInfoCacheObserver interface and usage thereof. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: init Created 9 years 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/browser/profiles/profile_info_cache_unittest.cc
===================================================================
--- chrome/browser/profiles/profile_info_cache_unittest.cc (revision 115334)
+++ chrome/browser/profiles/profile_info_cache_unittest.cc (working copy)
@@ -23,17 +23,19 @@
using content::BrowserThread;
-ProfileNameVerifierObserver::ProfileNameVerifierObserver() {
+ProfileNameVerifierObserver::ProfileNameVerifierObserver(
+ ProfileInfoCache* cache) : cache_(cache) {
+ DCHECK(cache_);
}
ProfileNameVerifierObserver::~ProfileNameVerifierObserver() {
}
void ProfileNameVerifierObserver::OnProfileAdded(
- const string16& profile_name,
- const string16& profile_base_dir,
const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+ const string16& profile_base_dir) {
+ size_t index = cache_->GetIndexOfProfileWithPath(profile_path);
+ string16 profile_name = cache_->GetNameOfProfileAtIndex(index);
EXPECT_TRUE(profile_names_.find(profile_name) == profile_names_.end());
profile_names_.insert(profile_name);
}
@@ -59,10 +61,10 @@
}
void ProfileNameVerifierObserver::OnProfileAvatarChanged(
- const string16& profile_name,
- const string16& profile_base_dir,
const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+ const string16& profile_base_dir) {
+ size_t index = cache_->GetIndexOfProfileWithPath(profile_path);
+ string16 profile_name = cache_->GetNameOfProfileAtIndex(index);
EXPECT_TRUE(profile_names_.find(profile_name) != profile_names_.end());
}
@@ -70,7 +72,8 @@
: testing_profile_manager_(
static_cast<TestingBrowserProcess*>(g_browser_process)),
ui_thread_(BrowserThread::UI, &ui_loop_),
- file_thread_(BrowserThread::FILE, &ui_loop_) {
+ file_thread_(BrowserThread::FILE, &ui_loop_),
+ name_observer_(GetCache()) {
}
ProfileInfoCacheTest::~ProfileInfoCacheTest() {

Powered by Google App Engine
This is Rietveld 408576698