OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test/base/testing_profile_manager.h" | 5 #include "chrome/test/base/testing_profile_manager.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/prefs/pref_service_syncable.h" | 9 #include "chrome/browser/prefs/pref_service_syncable.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 builder.SetPath(ProfileManager::GetGuestProfilePath()); | 123 builder.SetPath(ProfileManager::GetGuestProfilePath()); |
124 | 124 |
125 // Add the guest profile to the profile manager, but not to the info cache. | 125 // Add the guest profile to the profile manager, but not to the info cache. |
126 TestingProfile* profile = builder.Build().release(); | 126 TestingProfile* profile = builder.Build().release(); |
127 profile->set_profile_name(kGuestProfileName); | 127 profile->set_profile_name(kGuestProfileName); |
128 | 128 |
129 // Set up a profile with an off the record profile. | 129 // Set up a profile with an off the record profile. |
130 TestingProfile::Builder().BuildIncognito(profile); | 130 TestingProfile::Builder().BuildIncognito(profile); |
131 | 131 |
132 profile_manager_->AddProfile(profile); // Takes ownership. | 132 profile_manager_->AddProfile(profile); // Takes ownership. |
133 profile_manager_->SetGuestProfilePrefs(profile); | 133 profile_manager_->SetNonPersonalProfilePrefs(profile); |
134 | 134 |
135 testing_profiles_.insert(std::make_pair(kGuestProfileName, profile)); | 135 testing_profiles_.insert(std::make_pair(kGuestProfileName, profile)); |
136 | 136 |
137 return profile; | 137 return profile; |
138 } | 138 } |
139 | 139 |
140 TestingProfile* TestingProfileManager::CreateSystemProfile() { | 140 TestingProfile* TestingProfileManager::CreateSystemProfile() { |
141 DCHECK(called_set_up_); | 141 DCHECK(called_set_up_); |
142 | 142 |
143 // Create the profile and register it. | 143 // Create the profile and register it. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Set up the directory for profiles. | 237 // Set up the directory for profiles. |
238 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); | 238 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); |
239 | 239 |
240 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); | 240 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); |
241 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. | 241 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. |
242 | 242 |
243 profile_manager_->GetProfileInfoCache(). | 243 profile_manager_->GetProfileInfoCache(). |
244 set_disable_avatar_download_for_testing(true); | 244 set_disable_avatar_download_for_testing(true); |
245 called_set_up_ = true; | 245 called_set_up_ = true; |
246 } | 246 } |
OLD | NEW |