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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc

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/ui/webui/signin/user_manager_screen_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc b/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
index 1306d6e02848f494c72066030fb6637623ad915e..676f8968ac8d67bdee29af70a057d7446c2c882e 100644
--- a/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc
@@ -1,8 +1,13 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+
#include "base/command_line.h"
+#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profile_window.h"
+#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
@@ -61,3 +66,28 @@ IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageLoads) {
ProfileManager* profile_manager = g_browser_process->profile_manager();
EXPECT_EQ(num_pods, static_cast<int>(profile_manager->GetNumberOfProfiles()));
}
+
+IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageRedirectsToAboutChrome) {
+ std::string user_manager_url = chrome::kChromeUIUserManagerURL;
+ user_manager_url += profiles::kUserManagerSelectProfileAboutChrome;
+
+ ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
+ browser(), GURL(user_manager_url), 1);
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ base::string16 profile_name =
+ profiles::GetAvatarNameForProfile(browser()->profile()->GetPath());
+
+ std::string launch_js =
+ base::StringPrintf("Oobe.launchUser('', '%s')",
+ base::UTF16ToUTF8(profile_name).c_str());
+ bool result = content::ExecuteScript(web_contents, launch_js);
+ EXPECT_TRUE(result);
+ base::RunLoop().RunUntilIdle();
+
+ content::WebContents* about_chrome_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ GURL current_URL = about_chrome_contents->GetVisibleURL();
+ EXPECT_EQ(GURL(chrome::kChromeUIUberURL), current_URL);
+}
« no previous file with comments | « chrome/browser/ui/webui/signin/user_manager_screen_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698