Chromium Code Reviews| Index: chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc |
| diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc b/chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc |
| index 51223c7be3ee13d5d2a971f751b12ef53eba19d1..f13597f7a96b95e589e62bec39bf390b300db870 100644 |
| --- a/chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc |
| +++ b/chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc |
| @@ -14,6 +14,8 @@ |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/extensions/extension_browsertest.h" |
| +#include "chrome/browser/profiles/profile_attributes_entry.h" |
| +#include "chrome/browser/profiles/profile_attributes_storage.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/profiles/profile_metrics.h" |
| #include "chrome/browser/profiles/profiles_state.h" |
| @@ -70,14 +72,20 @@ Profile* CreateProfileOutsideUserDataDir() { |
| void SetupProfilesForLock(Profile* signed_in) { |
| const char* signed_in_email = "me@google.com"; |
|
Peter Kasting
2016/02/16 20:49:54
Nit: Compile-time constants like this should be na
|
| Profile* supervised = CreateTestingProfile("supervised"); |
|
Peter Kasting
2016/02/16 20:49:54
Nit: Declare variables as close to first use as po
lwchkg
2016/02/17 17:09:31
Thanks a lot!
On 2016/02/16 20:49:54, Peter Kasti
|
| - ProfileInfoCache* cache = &g_browser_process->profile_manager()-> |
| - GetProfileInfoCache(); |
| - cache->SetAuthInfoOfProfileAtIndex(cache->GetIndexOfProfileWithPath( |
| - signed_in->GetPath()), "12345", base::UTF8ToUTF16(signed_in_email)); |
| + |
| + ProfileAttributesStorage& storage = |
| + g_browser_process->profile_manager()->GetProfileAttributesStorage(); |
|
Peter Kasting
2016/02/16 20:49:54
Nit: Prefer pointers to non-const refs
lwchkg
2016/02/17 17:09:31
Done.
|
| + ProfileAttributesEntry* entry_signed_in; |
| + ProfileAttributesEntry* entry_supervised; |
| + ASSERT_TRUE(storage.GetProfileAttributesWithPath( |
| + signed_in->GetPath(), &entry_signed_in)); |
| + ASSERT_TRUE(storage.GetProfileAttributesWithPath( |
| + supervised->GetPath(), &entry_supervised)); |
| + |
| + entry_signed_in->SetAuthInfo("12345", base::UTF8ToUTF16(signed_in_email)); |
| signed_in->GetPrefs()-> |
| SetString(prefs::kGoogleServicesHostedDomain, "google.com"); |
| - cache->SetSupervisedUserIdOfProfileAtIndex(cache->GetIndexOfProfileWithPath( |
| - supervised->GetPath()), signed_in_email); |
| + entry_supervised->SetSupervisedUserId(signed_in_email); |
| EXPECT_TRUE(profiles::IsLockAvailable(signed_in)); |
| } |