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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 base::FilePath expected_default = | 196 base::FilePath expected_default = |
197 base::FilePath().AppendASCII(chrome::kInitialProfile); | 197 base::FilePath().AppendASCII(chrome::kInitialProfile); |
198 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 198 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
199 EXPECT_EQ(expected_default.value(), | 199 EXPECT_EQ(expected_default.value(), |
200 profile_manager->GetInitialProfileDir().value()); | 200 profile_manager->GetInitialProfileDir().value()); |
201 | 201 |
202 scoped_ptr<chromeos::MockUserManager> mock_user_manager; | 202 scoped_ptr<chromeos::MockUserManager> mock_user_manager; |
203 mock_user_manager.reset(new chromeos::MockUserManager()); | 203 mock_user_manager.reset(new chromeos::MockUserManager()); |
204 mock_user_manager->SetActiveUser("user@gmail.com"); | 204 mock_user_manager->SetActiveUser("user@gmail.com"); |
205 chromeos::User* active_user = mock_user_manager->GetActiveUser(); | 205 user_manager::User* active_user = mock_user_manager->GetActiveUser(); |
206 profile_manager->Observe(chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 206 profile_manager->Observe( |
207 content::NotificationService::AllSources(), | 207 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
208 content::Details<const chromeos::User>(active_user)); | 208 content::NotificationService::AllSources(), |
| 209 content::Details<const user_manager::User>(active_user)); |
209 base::FilePath expected_logged_in(profile_dir); | 210 base::FilePath expected_logged_in(profile_dir); |
210 EXPECT_EQ(expected_logged_in.value(), | 211 EXPECT_EQ(expected_logged_in.value(), |
211 profile_manager->GetInitialProfileDir().value()); | 212 profile_manager->GetInitialProfileDir().value()); |
212 VLOG(1) << temp_dir_.path().Append( | 213 VLOG(1) << temp_dir_.path().Append( |
213 profile_manager->GetInitialProfileDir()).value(); | 214 profile_manager->GetInitialProfileDir()).value(); |
214 } | 215 } |
215 | 216 |
216 #endif | 217 #endif |
217 | 218 |
218 TEST_F(ProfileManagerTest, CreateAndUseTwoProfiles) { | 219 TEST_F(ProfileManagerTest, CreateAndUseTwoProfiles) { |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 dest_path2.BaseName().MaybeAsASCII()); | 1209 dest_path2.BaseName().MaybeAsASCII()); |
1209 profile_manager->ScheduleProfileForDeletion(dest_path2, | 1210 profile_manager->ScheduleProfileForDeletion(dest_path2, |
1210 ProfileManager::CreateCallback()); | 1211 ProfileManager::CreateCallback()); |
1211 // Spin the message loop so that all the callbacks can finish running. | 1212 // Spin the message loop so that all the callbacks can finish running. |
1212 base::RunLoop().RunUntilIdle(); | 1213 base::RunLoop().RunUntilIdle(); |
1213 | 1214 |
1214 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); | 1215 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); |
1215 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); | 1216 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); |
1216 } | 1217 } |
1217 #endif // !defined(OS_MACOSX) | 1218 #endif // !defined(OS_MACOSX) |
OLD | NEW |