Index: chrome/browser/ui/browser_browsertest.cc |
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc |
index ac03700fe695c78442c32e3c893e94b3baee7642..c7d1fd9f725982e0b0fe3f4e4c7b218ead50b9c6 100644 |
--- a/chrome/browser/ui/browser_browsertest.cc |
+++ b/chrome/browser/ui/browser_browsertest.cc |
@@ -49,6 +49,7 @@ |
#include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
#include "chrome/browser/ui/tabs/pinned_tab_codec.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
+#include "chrome/browser/ui/user_manager.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
#include "chrome/common/pref_names.h" |
@@ -2199,6 +2200,32 @@ class LaunchBrowserWithTrailingSlashDatadir : public BrowserTest { |
base::ScopedTempDir temp_dir_; |
}; |
+#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
+// This test verifies that if Chrome is launched with an invalid |
+// profile-directory argument, then the User Manager is shown instead. |
+class LaunchBrowserWithInvalidProfileDirectory : public BrowserTest { |
+ public: |
+ LaunchBrowserWithInvalidProfileDirectory() {} |
+ |
+ virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
+ command_line->AppendSwitch(switches::kEnableNewAvatarMenu); |
+ command_line->AppendSwitchASCII(switches::kProfileDirectory, |
+ "SomeOtherProfile"); |
+ } |
+ |
+ base::ScopedTempDir temp_dir_; |
+}; |
+ |
+IN_PROC_BROWSER_TEST_F(LaunchBrowserWithInvalidProfileDirectory, |
+ TestUserManagerShown) { |
+ // No browser window should be open, and the User Manager should be showing. |
+ EXPECT_FALSE(browser()); |
+ EXPECT_TRUE(UserManager::IsShowing()); |
+ // Hide the User Manager so that the test can die. |
+ UserManager::Hide(); |
+} |
+#endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
+ |
IN_PROC_BROWSER_TEST_F(LaunchBrowserWithTrailingSlashDatadir, |
TestTrailingSlashUserDataDir) { |
// Verify that the window is present. |