| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 base::FilePath().AppendASCII(chrome::kInitialProfile); | 159 base::FilePath().AppendASCII(chrome::kInitialProfile); |
| 160 EXPECT_EQ( | 160 EXPECT_EQ( |
| 161 expected_default.value(), | 161 expected_default.value(), |
| 162 g_browser_process->profile_manager()->GetInitialProfileDir().value()); | 162 g_browser_process->profile_manager()->GetInitialProfileDir().value()); |
| 163 } | 163 } |
| 164 | 164 |
| 165 #if defined(OS_CHROMEOS) | 165 #if defined(OS_CHROMEOS) |
| 166 // This functionality only exists on Chrome OS. | 166 // This functionality only exists on Chrome OS. |
| 167 TEST_F(ProfileManagerTest, LoggedInProfileDir) { | 167 TEST_F(ProfileManagerTest, LoggedInProfileDir) { |
| 168 CommandLine *cl = CommandLine::ForCurrentProcess(); | 168 CommandLine *cl = CommandLine::ForCurrentProcess(); |
| 169 std::string profile_dir("my_user"); | 169 std::string profile_dir(chrome::kTestUserProfileDir); |
| 170 | 170 |
| 171 cl->AppendSwitchASCII(chromeos::switches::kLoginProfile, profile_dir); | 171 cl->AppendSwitchASCII(chromeos::switches::kLoginProfile, profile_dir); |
| 172 | 172 |
| 173 base::FilePath expected_default = | 173 base::FilePath expected_default = |
| 174 base::FilePath().AppendASCII(chrome::kInitialProfile); | 174 base::FilePath().AppendASCII(chrome::kInitialProfile); |
| 175 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 175 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 176 EXPECT_EQ(expected_default.value(), | 176 EXPECT_EQ(expected_default.value(), |
| 177 profile_manager->GetInitialProfileDir().value()); | 177 profile_manager->GetInitialProfileDir().value()); |
| 178 | 178 |
| 179 scoped_ptr<chromeos::MockUserManager> mock_user_manager; | 179 scoped_ptr<chromeos::MockUserManager> mock_user_manager; |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 dest_path2.BaseName().MaybeAsASCII()); | 762 dest_path2.BaseName().MaybeAsASCII()); |
| 763 profile_manager->ScheduleProfileForDeletion(dest_path2, | 763 profile_manager->ScheduleProfileForDeletion(dest_path2, |
| 764 ProfileManager::CreateCallback()); | 764 ProfileManager::CreateCallback()); |
| 765 // Spin the message loop so that all the callbacks can finish running. | 765 // Spin the message loop so that all the callbacks can finish running. |
| 766 base::RunLoop().RunUntilIdle(); | 766 base::RunLoop().RunUntilIdle(); |
| 767 | 767 |
| 768 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); | 768 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); |
| 769 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); | 769 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); |
| 770 } | 770 } |
| 771 #endif // !defined(OS_MACOSX) | 771 #endif // !defined(OS_MACOSX) |
| OLD | NEW |