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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc

Issue 1701563002: Refactor ProfileInfoCache in c/b/ui/views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/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));
}

Powered by Google App Engine
This is Rietveld 408576698