Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: chrome/browser/app_controller_mac_unittest.mm

Issue 1113333003: Don't create a new profile when cleaning up stale ephemeral profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fix? Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 ASSERT_EQ(2U, profile_manager_.profile_manager()->GetLoadedProfiles().size()); 79 ASSERT_EQ(2U, profile_manager_.profile_manager()->GetLoadedProfiles().size());
80 80
81 PrefService* local_state = g_browser_process->local_state(); 81 PrefService* local_state = g_browser_process->local_state();
82 local_state->SetString(prefs::kProfileLastUsed, 82 local_state->SetString(prefs::kProfileLastUsed,
83 dest_path1.BaseName().MaybeAsASCII()); 83 dest_path1.BaseName().MaybeAsASCII());
84 84
85 base::scoped_nsobject<AppController> ac([[AppController alloc] init]); 85 base::scoped_nsobject<AppController> ac([[AppController alloc] init]);
86 86
87 // Delete the active profile. 87 // Delete the active profile.
88 profile_manager_.profile_manager()->ScheduleProfileForDeletion( 88 profile_manager_.profile_manager()->ScheduleProfileForDeletion(
89 dest_path1, ProfileManager::CreateCallback()); 89 dest_path1, false /* suppress_profile_creation */,
90 ProfileManager::CreateCallback());
90 91
91 base::RunLoop().RunUntilIdle(); 92 base::RunLoop().RunUntilIdle();
92 93
93 EXPECT_EQ(dest_path2, [ac lastProfile]->GetPath()); 94 EXPECT_EQ(dest_path2, [ac lastProfile]->GetPath());
94 } 95 }
95 96
96 TEST_F(AppControllerTest, TestSigninMenuItemNoErrors) { 97 TEST_F(AppControllerTest, TestSigninMenuItemNoErrors) {
97 base::scoped_nsobject<NSMenuItem> syncMenuItem( 98 base::scoped_nsobject<NSMenuItem> syncMenuItem(
98 [[NSMenuItem alloc] initWithTitle:@"" 99 [[NSMenuItem alloc] initWithTitle:@""
99 action:@selector(commandDispatch) 100 action:@selector(commandDispatch)
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 218
218 [followingNonSeparator setHidden:YES]; 219 [followingNonSeparator setHidden:YES];
219 [AppController updateSigninItem:signinMenuItem 220 [AppController updateSigninItem:signinMenuItem
220 shouldShow:YES 221 shouldShow:YES
221 currentProfile:profile_]; 222 currentProfile:profile_];
222 223
223 EXPECT_TRUE([followingNonSeparator isEnabled]); 224 EXPECT_TRUE([followingNonSeparator isEnabled]);
224 EXPECT_FALSE([signinMenuItem isHidden]); 225 EXPECT_FALSE([signinMenuItem isHidden]);
225 EXPECT_TRUE([followingNonSeparator isHidden]); 226 EXPECT_TRUE([followingNonSeparator isHidden]);
226 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698