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

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: mark's post-test comments 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..8ad16ede2c7650dc12e0683b4ab91a03d7681907 100644
--- a/chrome/browser/app_controller_mac_browsertest.mm
+++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -278,6 +278,35 @@ IN_PROC_BROWSER_TEST_F(AppControllerNewProfileManagementBrowserTest,
UserManager::Hide();
}
+
noms (inactive) 2014/10/30 17:45:11 nit: is there an extra \n here?
Mike Lerman 2014/10/30 18:06:01 Done.
+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
noms (inactive) 2014/10/30 17:45:11 nit: comment should end in a .
Mike Lerman 2014/10/30 18:06:01 Done.
+ 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());
noms (inactive) 2014/10/30 17:45:11 I think you have to explicitly call UserManager::H
Mike Lerman 2014/10/30 18:06:01 Done.
+}
+
class AppControllerOpenShortcutBrowserTest : public InProcessBrowserTest {
protected:
AppControllerOpenShortcutBrowserTest() {
@@ -330,4 +359,5 @@ IN_PROC_BROWSER_TEST_F(AppControllerOpenShortcutBrowserTest,
->GetLastCommittedURL());
}
+
noms (inactive) 2014/10/30 17:45:11 nit: i think there's an extra \n?
Mike Lerman 2014/10/30 18:06:01 Done.
} // namespace
« 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