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

Unified Diff: chrome/browser/app_controller_mac_browsertest.mm

Issue 631163004: Mac - show user manager before opening browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: noms nits Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/profiles/profile_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac_browsertest.mm
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm
index f8442c765f5f930221905f2775829d82b536a28c..ff6b010b7511645c01cd88d7206613b2560316fe 100644
--- a/chrome/browser/app_controller_mac_browsertest.mm
+++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -278,6 +278,36 @@ IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest,
UserManager::Hide();
}
+IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest,
+ AboutChromeForcesUserManager) {
+ base::scoped_nsobject<AppController> ac([[AppController alloc] init]);
+
+ // Create the guest profile, and set it as the last used profile so the
+ // app controller can use it on init.
+ CreateAndWaitForGuestProfile();
+ PrefService* local_state = g_browser_process->local_state();
+ local_state->SetString(prefs::kProfileLastUsed, chrome::kGuestProfileDir);
+
+ // Prohibiting guest mode forces the user manager flow for About Chrome.
+ local_state->SetBoolean(prefs::kBrowserGuestModeEnabled, false);
+
+ Profile* guest_profile = [ac lastProfile];
+ EXPECT_EQ(ProfileManager::GetGuestProfilePath(), guest_profile->GetPath());
+ EXPECT_TRUE(guest_profile->IsGuestSession());
+
+ // Tell the browser to open About Chrome.
+ EXPECT_EQ(1u, active_browser_list_->size());
+ [ac orderFrontStandardAboutPanel:NSApp];
+
+ base::RunLoop().RunUntilIdle();
+
+ // No new browser is opened; the User Manager opens instead.
+ EXPECT_EQ(1u, active_browser_list_->size());
+ EXPECT_TRUE(UserManager::IsShowing());
+
+ UserManager::Hide();
+}
+
class AppControllerOpenShortcutBrowserTest : public InProcessBrowserTest {
protected:
AppControllerOpenShortcutBrowserTest() {
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/profiles/profile_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698