Chromium Code Reviews| 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..5c6df3de6ee41d71a269e7c34eee43a48c915496 100644 |
| --- a/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc |
| +++ b/chrome/browser/ui/webui/signin/user_manager_ui_browsertest.cc |
| @@ -2,7 +2,11 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
|
Mark Mentovai
2014/10/30 17:34:27
There seems to be a missing blank line after this.
Mike Lerman
2014/10/30 17:37:25
Done.
|
| #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 +65,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 userManagerURL = chrome::kChromeUIUserManagerURL; |
|
Mark Mentovai
2014/10/30 17:34:27
What’s up with the naming? user_manager_url.
Mike Lerman
2014/10/30 17:37:25
Sorry, went on vacation and my brain reverted to J
|
| + userManagerURL += profiles::kUserManagerSelectProfileAboutChrome; |
| + |
| + ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
| + browser(), GURL(userManagerURL), 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); |
| +} |