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

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

Issue 9271018: Merge 115621 - Refactor ProfileInfoCacheObserver interface and usage thereof. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src/
Patch Set: Created 8 years, 11 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/browser/profiles/profile_info_cache_unittest.cc
===================================================================
--- chrome/browser/profiles/profile_info_cache_unittest.cc (revision 118523)
+++ chrome/browser/profiles/profile_info_cache_unittest.cc (working copy)
@@ -22,35 +22,42 @@
using content::BrowserThread;
-ProfileNameVerifierObserver::ProfileNameVerifierObserver() {
+ProfileNameVerifierObserver::ProfileNameVerifierObserver(
+ TestingProfileManager* testing_profile_manager)
+ : testing_profile_manager_(testing_profile_manager) {
+ DCHECK(testing_profile_manager_);
}
ProfileNameVerifierObserver::~ProfileNameVerifierObserver() {
}
void ProfileNameVerifierObserver::OnProfileAdded(
- const string16& profile_name,
- const string16& profile_base_dir,
- const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+ const FilePath& profile_path) {
+ string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(profile_path));
EXPECT_TRUE(profile_names_.find(profile_name) == profile_names_.end());
profile_names_.insert(profile_name);
}
void ProfileNameVerifierObserver::OnProfileWillBeRemoved(
- const string16& profile_name) {
+ const FilePath& profile_path) {
+ string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(profile_path));
EXPECT_TRUE(profile_names_.find(profile_name) != profile_names_.end());
profile_names_.erase(profile_name);
}
void ProfileNameVerifierObserver::OnProfileWasRemoved(
+ const FilePath& profile_path,
const string16& profile_name) {
EXPECT_TRUE(profile_names_.find(profile_name) == profile_names_.end());
}
void ProfileNameVerifierObserver::OnProfileNameChanged(
- const string16& old_profile_name,
- const string16& new_profile_name) {
+ const FilePath& profile_path,
+ const string16& old_profile_name) {
+ string16 new_profile_name = GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(profile_path));
EXPECT_TRUE(profile_names_.find(old_profile_name) != profile_names_.end());
EXPECT_TRUE(profile_names_.find(new_profile_name) == profile_names_.end());
profile_names_.erase(old_profile_name);
@@ -58,18 +65,22 @@
}
void ProfileNameVerifierObserver::OnProfileAvatarChanged(
- const string16& profile_name,
- const string16& profile_base_dir,
- const FilePath& profile_path,
- const gfx::Image* avatar_image) {
+ const FilePath& profile_path) {
+ string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(profile_path));
EXPECT_TRUE(profile_names_.find(profile_name) != profile_names_.end());
}
+ProfileInfoCache* ProfileNameVerifierObserver::GetCache() {
+ return testing_profile_manager_->profile_info_cache();
+}
+
ProfileInfoCacheTest::ProfileInfoCacheTest()
: 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_(&testing_profile_manager_) {
}
ProfileInfoCacheTest::~ProfileInfoCacheTest() {
« no previous file with comments | « chrome/browser/profiles/profile_info_cache_unittest.h ('k') | chrome/browser/profiles/profile_shortcut_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698