Index: chrome/browser/profiles/profile_manager_unittest.cc |
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc |
index 2644176d698d5dc30f0b472fd33ec4b9baf948ef..79d5a9cef07c74e1b33bfdf8dd34266de3dfdc0c 100644 |
--- a/chrome/browser/profiles/profile_manager_unittest.cc |
+++ b/chrome/browser/profiles/profile_manager_unittest.cc |
@@ -503,13 +503,16 @@ TEST_F(ProfileManagerTest, LastOpenedProfilesDoesNotContainIncognito) { |
ProfileManager* profile_manager = g_browser_process->profile_manager(); |
// Successfully create the profiles. |
- Profile* profile1 = profile_manager->GetProfile(dest_path1); |
+ TestingProfile* profile1 = |
+ static_cast<TestingProfile*>(profile_manager->GetProfile(dest_path1)); |
ASSERT_TRUE(profile1); |
- TestingProfile* profile2 = |
- static_cast<TestingProfile*>(profile_manager->GetProfile(dest_path2)); |
+ // incognito profiles should not be managed by the profile manager but by the |
+ // original profile. |
+ TestingProfile* profile2 = new TestingProfile(); |
ASSERT_TRUE(profile2); |
profile2->set_incognito(true); |
+ profile1->SetOffTheRecordProfile(profile2); |
std::vector<Profile*> last_opened_profiles = |
profile_manager->GetLastOpenedProfiles(); |