diff options
Diffstat (limited to 'chrome/browser/ui/browser_command_controller_unittest.cc')
-rw-r--r-- | chrome/browser/ui/browser_command_controller_unittest.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc index 9fe9857..a796437 100644 --- a/chrome/browser/ui/browser_command_controller_unittest.cc +++ b/chrome/browser/ui/browser_command_controller_unittest.cc @@ -246,16 +246,19 @@ TEST_F(BrowserCommandControllerTest, NewAvatarMenuEnabledInGuestMode) { ASSERT_TRUE(testing_profile_manager.SetUp()); // Set up guest a profile. + scoped_ptr<TestingProfile> original_profile = + TestingProfile::Builder().Build(); TestingProfile::Builder guest_builder; - guest_builder.SetIncognito(); // Guest profiles are off the record. guest_builder.SetGuestSession(); guest_builder.SetPath(ProfileManager::GetGuestProfilePath()); - scoped_ptr<TestingProfile>guest_profile = guest_builder.Build(); + // Browsers in Guest mode must be off the record profiles. + TestingProfile* guest_profile = + guest_builder.BuildIncognito(original_profile.get()); ASSERT_TRUE(guest_profile->IsGuestSession()); // Create a new browser based on the guest profile. - Browser::CreateParams profile_params(guest_profile.get(), + Browser::CreateParams profile_params(guest_profile, chrome::GetActiveDesktop()); scoped_ptr<Browser> guest_browser( chrome::CreateBrowserWithTestWindowForParams(&profile_params)); @@ -430,14 +433,10 @@ TEST_F(BrowserCommandControllerFullscreenTest, TEST_F(BrowserCommandControllerTest, IncognitoModeOnSigninAllowedPrefChange) { // Set up a profile with an off the record profile. - TestingProfile::Builder builder; - builder.SetIncognito(); - scoped_ptr<TestingProfile> profile2(builder.Build()); - TestingProfile::Builder builder2; - scoped_ptr<TestingProfile> profile1 = builder2.Build(); - profile2->SetOriginalProfile(profile1.get()); + scoped_ptr<TestingProfile> profile1 = TestingProfile::Builder().Build(); + Profile* profile2 = profile1->GetOffTheRecordProfile(); + EXPECT_EQ(profile2->GetOriginalProfile(), profile1.get()); - profile1->SetOffTheRecordProfile(profile2.PassAs<Profile>()); // Create a new browser based on the off the record profile. Browser::CreateParams profile_params(profile1->GetOffTheRecordProfile(), |