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/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 #if defined(OS_CHROMEOS) | 447 #if defined(OS_CHROMEOS) |
448 TEST_F(ProfileManagerGuestTest, GuestProfileIngonito) { | 448 TEST_F(ProfileManagerGuestTest, GuestProfileIngonito) { |
449 Profile* primary_profile = ProfileManager::GetPrimaryUserProfile(); | 449 Profile* primary_profile = ProfileManager::GetPrimaryUserProfile(); |
450 EXPECT_TRUE(primary_profile->IsOffTheRecord()); | 450 EXPECT_TRUE(primary_profile->IsOffTheRecord()); |
451 | 451 |
452 Profile* active_profile = ProfileManager::GetActiveUserProfile(); | 452 Profile* active_profile = ProfileManager::GetActiveUserProfile(); |
453 EXPECT_TRUE(active_profile->IsOffTheRecord()); | 453 EXPECT_TRUE(active_profile->IsOffTheRecord()); |
454 | 454 |
455 EXPECT_TRUE(active_profile->IsSameProfile(primary_profile)); | 455 EXPECT_TRUE(active_profile->IsSameProfile(primary_profile)); |
456 | 456 |
457 Profile* last_used_profile = ProfileManager::GetLastUsedProfile(); | 457 Profile* last_used_profile = |
| 458 g_browser_process->profile_manager()->GetLastUsedProfile(); |
458 EXPECT_TRUE(last_used_profile->IsOffTheRecord()); | 459 EXPECT_TRUE(last_used_profile->IsOffTheRecord()); |
459 | 460 |
460 EXPECT_TRUE(last_used_profile->IsSameProfile(active_profile)); | 461 EXPECT_TRUE(last_used_profile->IsSameProfile(active_profile)); |
461 } | 462 } |
462 #endif | 463 #endif |
463 | 464 |
464 TEST_F(ProfileManagerTest, AutoloadProfilesWithBackgroundApps) { | 465 TEST_F(ProfileManagerTest, AutoloadProfilesWithBackgroundApps) { |
465 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 466 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
466 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 467 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
467 local_state_.Get()->SetUserPref(prefs::kBackgroundModeEnabled, | 468 local_state_.Get()->SetUserPref(prefs::kBackgroundModeEnabled, |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 dest_path2.BaseName().MaybeAsASCII()); | 1355 dest_path2.BaseName().MaybeAsASCII()); |
1355 profile_manager->ScheduleProfileForDeletion(dest_path2, | 1356 profile_manager->ScheduleProfileForDeletion(dest_path2, |
1356 ProfileManager::CreateCallback()); | 1357 ProfileManager::CreateCallback()); |
1357 // Spin the message loop so that all the callbacks can finish running. | 1358 // Spin the message loop so that all the callbacks can finish running. |
1358 base::RunLoop().RunUntilIdle(); | 1359 base::RunLoop().RunUntilIdle(); |
1359 | 1360 |
1360 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); | 1361 EXPECT_EQ(dest_path3, profile_manager->GetLastUsedProfile()->GetPath()); |
1361 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); | 1362 EXPECT_EQ(profile_name3, local_state->GetString(prefs::kProfileLastUsed)); |
1362 } | 1363 } |
1363 #endif // !defined(OS_MACOSX) | 1364 #endif // !defined(OS_MACOSX) |
OLD | NEW |