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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs, | 63 std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs, |
64 const base::string16& user_name, | 64 const base::string16& user_name, |
65 int avatar_id, | 65 int avatar_id, |
66 const std::string& supervised_user_id, | 66 const std::string& supervised_user_id, |
67 const TestingProfile::TestingFactories& factories) { | 67 const TestingProfile::TestingFactories& factories) { |
68 DCHECK(called_set_up_); | 68 DCHECK(called_set_up_); |
69 | 69 |
70 // Create a path for the profile based on the name. | 70 // Create a path for the profile based on the name. |
71 base::FilePath profile_path(profiles_dir_.GetPath()); | 71 base::FilePath profile_path(profiles_dir_.GetPath()); |
72 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
73 if (profile_name != chrome::kInitialProfile) { | 73 if (profile_name != chrome::kInitialProfile && |
| 74 profile_name != chromeos::ProfileHelper::GetLockScreenAppProfileName()) { |
74 profile_path = | 75 profile_path = |
75 profile_path.Append(chromeos::ProfileHelper::Get()->GetUserProfileDir( | 76 profile_path.Append(chromeos::ProfileHelper::Get()->GetUserProfileDir( |
76 chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting( | 77 chromeos::ProfileHelper::GetUserIdHashByUserIdForTesting( |
77 profile_name))); | 78 profile_name))); |
78 } else { | 79 } else { |
79 profile_path = profile_path.AppendASCII(profile_name); | 80 profile_path = profile_path.AppendASCII(profile_name); |
80 } | 81 } |
81 #else | 82 #else |
82 profile_path = profile_path.AppendASCII(profile_name); | 83 profile_path = profile_path.AppendASCII(profile_name); |
83 #endif | 84 #endif |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Set up the directory for profiles. | 248 // Set up the directory for profiles. |
248 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); | 249 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); |
249 | 250 |
250 profile_manager_ = new testing::ProfileManager(profiles_dir_.GetPath()); | 251 profile_manager_ = new testing::ProfileManager(profiles_dir_.GetPath()); |
251 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. | 252 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. |
252 | 253 |
253 profile_manager_->GetProfileInfoCache(). | 254 profile_manager_->GetProfileInfoCache(). |
254 set_disable_avatar_download_for_testing(true); | 255 set_disable_avatar_download_for_testing(true); |
255 called_set_up_ = true; | 256 called_set_up_ = true; |
256 } | 257 } |
OLD | NEW |