| Index: chrome/browser/ui/app_list/app_list_service_unittest.cc
|
| diff --git a/chrome/browser/ui/app_list/app_list_service_unittest.cc b/chrome/browser/ui/app_list/app_list_service_unittest.cc
|
| index 7b342d0dfe9dacad83924fd4b1549ebc615dab31..d13add43a3c3154601b28f6440cd0f06ca760c1b 100644
|
| --- a/chrome/browser/ui/app_list/app_list_service_unittest.cc
|
| +++ b/chrome/browser/ui/app_list/app_list_service_unittest.cc
|
| @@ -162,6 +162,26 @@ TEST_F(AppListServiceUnitTest,
|
| EXPECT_EQ(0, service_->destroy_app_list_call_count());
|
| }
|
|
|
| +TEST_F(AppListServiceUnitTest, RefusesToLoadGuestAppListProfile) {
|
| + // Unlikely, but if somehow the user's app_list.profile pref was set to the
|
| + // guest profile, make sure we refuse to load it (or it would crash).
|
| + local_state_->SetString(prefs::kAppListProfile, chrome::kGuestProfileDir);
|
| + local_state_->SetString(prefs::kProfileLastUsed, "last-used");
|
| + base::FilePath initial_profile_path = user_data_dir_.AppendASCII("last-used");
|
| + EXPECT_EQ(initial_profile_path,
|
| + service_->GetProfilePath(profile_store_->GetUserDataDir()));
|
| +}
|
| +
|
| +TEST_F(AppListServiceUnitTest, RefusesToLoadGuestLastUsedProfile) {
|
| + // If the user's most recent browser session was a guest session, make sure we
|
| + // do not open a guest profile in the launcher (which would crash).
|
| + local_state_->SetString(prefs::kProfileLastUsed, chrome::kGuestProfileDir);
|
| + base::FilePath initial_profile_path =
|
| + user_data_dir_.AppendASCII(chrome::kInitialProfile);
|
| + EXPECT_EQ(initial_profile_path,
|
| + service_->GetProfilePath(profile_store_->GetUserDataDir()));
|
| +}
|
| +
|
| TEST_F(AppListServiceUnitTest, SwitchingProfilesPersists) {
|
| profile_store_->LoadProfile(profile1_.get());
|
| profile_store_->LoadProfile(profile2_.get());
|
|
|