Index: chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc |
diff --git a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc |
index 398aa3e530587dc4023790976486a4a39bb34522..3d5c060dbf3e51c7f6c501a8aec680243292badc 100644 |
--- a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc |
+++ b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc |
@@ -27,9 +27,6 @@ using base::ASCIIToUTF16; |
namespace { |
-// As defined in /chromeos/dbus/cryptohome_client.cc. |
-static const char kUserIdHashSuffix[] = "-hash"; |
- |
class MockObserver : public AvatarMenuObserver { |
public: |
MockObserver() : count_(0) {} |
@@ -79,18 +76,11 @@ class ProfileListChromeOSTest : public testing::Test { |
// Add a user to the fake user manager. |
GetFakeUserManager()->AddUser(email_string); |
if (log_in) { |
- GetFakeUserManager()->UserLoggedIn( |
- email_string, |
- email_string + kUserIdHashSuffix, |
- false); |
+ GetFakeUserManager()->LoginUser(email_string); |
} |
Nikita (slow)
2014/08/19 11:09:48
nit: drop {}
dzhioev (left Google)
2014/08/20 20:21:36
Done.
|
// Create a profile for the user. |
- manager()->CreateTestingProfile( |
- chrome::kProfileDirPrefix + email_string + kUserIdHashSuffix, |
- scoped_ptr<PrefServiceSyncable>(), |
- ASCIIToUTF16(email_string), 0, std::string(), |
- TestingProfile::TestingFactories()); |
+ manager()->CreateTestingProfile(email_string); |
} |
AvatarMenu* GetAvatarMenu() { |
@@ -108,9 +98,9 @@ class ProfileListChromeOSTest : public testing::Test { |
return avatar_menu_.get(); |
} |
- void ActiveUserChanged(ProfileHelper* profile_helper, |
- const std::string& hash) { |
- profile_helper->ActiveUserHashChanged(hash); |
+ void ActiveUserChanged(const base::string16& name) { |
+ std::string email_string = base::UTF16ToASCII(name) + "@example.com"; |
+ GetFakeUserManager()->SwitchActiveUser(email_string); |
} |
TestingProfileManager* manager() { return &manager_; } |
@@ -220,10 +210,7 @@ TEST_F(ProfileListChromeOSTest, ActiveItem) { |
AddProfile(name1, true); |
AddProfile(name2, true); |
- // Initialize ProfileHelper, it will be accessed from GetActiveProfileIndex. |
- std::string email_string = base::UTF16ToASCII(name1) + "@example.com"; |
- std::string hash = email_string + kUserIdHashSuffix; |
- ActiveUserChanged(ProfileHelper::Get(), hash); |
+ ActiveUserChanged(name1); |
AvatarMenu* menu = GetAvatarMenu(); |