OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return profile; | 52 return profile; |
53 } | 53 } |
54 | 54 |
55 // Set up the profiles to enable Lock. Takes as parameter a profile that will be | 55 // Set up the profiles to enable Lock. Takes as parameter a profile that will be |
56 // signed in, and also creates a supervised user (necessary for lock). | 56 // signed in, and also creates a supervised user (necessary for lock). |
57 void SetupProfilesForLock(Profile* signed_in) { | 57 void SetupProfilesForLock(Profile* signed_in) { |
58 const char* signed_in_email = "me@google.com"; | 58 const char* signed_in_email = "me@google.com"; |
59 Profile* supervised = CreateTestingProfile("supervised"); | 59 Profile* supervised = CreateTestingProfile("supervised"); |
60 ProfileInfoCache* cache = &g_browser_process->profile_manager()-> | 60 ProfileInfoCache* cache = &g_browser_process->profile_manager()-> |
61 GetProfileInfoCache(); | 61 GetProfileInfoCache(); |
62 cache->SetUserNameOfProfileAtIndex(cache->GetIndexOfProfileWithPath( | 62 cache->SetAuthInfoOfProfileAtIndex(cache->GetIndexOfProfileWithPath( |
63 signed_in->GetPath()), base::UTF8ToUTF16(signed_in_email)); | 63 signed_in->GetPath()), "12345", base::UTF8ToUTF16(signed_in_email)); |
64 signed_in->GetPrefs()-> | 64 signed_in->GetPrefs()-> |
65 SetString(prefs::kGoogleServicesHostedDomain, "google.com"); | 65 SetString(prefs::kGoogleServicesHostedDomain, "google.com"); |
66 cache->SetSupervisedUserIdOfProfileAtIndex(cache->GetIndexOfProfileWithPath( | 66 cache->SetSupervisedUserIdOfProfileAtIndex(cache->GetIndexOfProfileWithPath( |
67 supervised->GetPath()), signed_in_email); | 67 supervised->GetPath()), signed_in_email); |
68 | 68 |
69 EXPECT_TRUE(profiles::IsLockAvailable(signed_in)); | 69 EXPECT_TRUE(profiles::IsLockAvailable(signed_in)); |
70 } | 70 } |
71 | 71 |
72 } // namespace | 72 } // namespace |
73 | 73 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 WaitForUserManager(); | 240 WaitForUserManager(); |
241 // Assert that the first profile's extensions are not blocked. | 241 // Assert that the first profile's extensions are not blocked. |
242 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); | 242 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); |
243 ASSERT_EQ(0U, registry->blocked_extensions().size()); | 243 ASSERT_EQ(0U, registry->blocked_extensions().size()); |
244 | 244 |
245 // We need to hide the User Manager or else the process can't die. | 245 // We need to hide the User Manager or else the process can't die. |
246 UserManager::Hide(); | 246 UserManager::Hide(); |
247 } | 247 } |
248 | 248 |
249 #endif | 249 #endif |
OLD | NEW |