| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 // This switch is needed to skip non-test specific behavior in | 395 // This switch is needed to skip non-test specific behavior in |
| 396 // ProfileManager (accessing DBusThreadManager). | 396 // ProfileManager (accessing DBusThreadManager). |
| 397 cl->AppendSwitch(switches::kTestType); | 397 cl->AppendSwitch(switches::kTestType); |
| 398 | 398 |
| 399 cl->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 399 cl->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
| 400 std::string(chrome::kProfileDirPrefix) + | 400 std::string(chrome::kProfileDirPrefix) + |
| 401 chromeos::UserManager::kGuestUserName); | 401 chromeos::UserManager::kGuestUserName); |
| 402 cl->AppendSwitch(chromeos::switches::kGuestSession); | 402 cl->AppendSwitch(chromeos::switches::kGuestSession); |
| 403 cl->AppendSwitch(::switches::kIncognito); | 403 cl->AppendSwitch(::switches::kIncognito); |
| 404 | 404 |
| 405 chromeos::UserManager::Get()->UserLoggedIn( | 405 chromeos::GetUserManager()->UserLoggedIn( |
| 406 chromeos::UserManager::kGuestUserName, | 406 chromeos::UserManager::kGuestUserName, |
| 407 chromeos::UserManager::kGuestUserName, | 407 chromeos::UserManager::kGuestUserName, |
| 408 false); | 408 false); |
| 409 #endif | 409 #endif |
| 410 } | 410 } |
| 411 }; | 411 }; |
| 412 | 412 |
| 413 TEST_F(ProfileManagerGuestTest, GetLastUsedProfileAllowedByPolicy) { | 413 TEST_F(ProfileManagerGuestTest, GetLastUsedProfileAllowedByPolicy) { |
| 414 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 414 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 415 ASSERT_TRUE(profile_manager); | 415 ASSERT_TRUE(profile_manager); |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 dest_path2.BaseName().MaybeAsASCII()); | 1116 dest_path2.BaseName().MaybeAsASCII()); |
| 1117 profile_manager->ScheduleProfileForDeletion(dest_path2, | 1117 profile_manager->ScheduleProfileForDeletion(dest_path2, |
| 1118 ProfileManager::CreateCallback()); | 1118 ProfileManager::CreateCallback()); |
| 1119 // Spin the message loop so that all the callbacks can finish running. | 1119 // Spin the message loop so that all the callbacks can finish running. |
| 1120 base::RunLoop().RunUntilIdle(); | 1120 base::RunLoop().RunUntilIdle(); |
| 1121 | 1121 |
| 1122 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); | 1122 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); |
| 1123 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); | 1123 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); |
| 1124 } | 1124 } |
| 1125 #endif // !defined(OS_MACOSX) | 1125 #endif // !defined(OS_MACOSX) |
| OLD | NEW |