OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // 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.
| |
4 #include "base/command_line.h" | 4 #include "base/command_line.h" |
5 #include "base/strings/stringprintf.h" | |
6 #include "base/strings/utf_string_conversions.h" | |
5 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 #include "chrome/browser/profiles/profile_window.h" | |
9 #include "chrome/browser/profiles/profiles_state.h" | |
6 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
8 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
10 #include "chrome/grit/chromium_strings.h" | 14 #include "chrome/grit/chromium_strings.h" |
11 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
12 #include "chrome/test/base/testing_browser_process.h" | 16 #include "chrome/test/base/testing_browser_process.h" |
13 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
14 #include "components/signin/core/common/profile_management_switches.h" | 18 #include "components/signin/core/common/profile_management_switches.h" |
15 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 58 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
55 web_contents, | 59 web_contents, |
56 "domAutomationController.send(" | 60 "domAutomationController.send(" |
57 "parseInt(document.getElementById('pod-row').getAttribute('ncolumns')))", | 61 "parseInt(document.getElementById('pod-row').getAttribute('ncolumns')))", |
58 &num_pods)); | 62 &num_pods)); |
59 | 63 |
60 // There should be one user pod for each profile. | 64 // There should be one user pod for each profile. |
61 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 65 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
62 EXPECT_EQ(num_pods, static_cast<int>(profile_manager->GetNumberOfProfiles())); | 66 EXPECT_EQ(num_pods, static_cast<int>(profile_manager->GetNumberOfProfiles())); |
63 } | 67 } |
68 | |
69 IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageRedirectsToAboutChrome) { | |
70 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
| |
71 userManagerURL += profiles::kUserManagerSelectProfileAboutChrome; | |
72 | |
73 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | |
74 browser(), GURL(userManagerURL), 1); | |
75 content::WebContents* web_contents = | |
76 browser()->tab_strip_model()->GetActiveWebContents(); | |
77 | |
78 base::string16 profile_name = | |
79 profiles::GetAvatarNameForProfile(browser()->profile()->GetPath()); | |
80 | |
81 std::string launch_js = | |
82 base::StringPrintf("Oobe.launchUser('', '%s')", | |
83 base::UTF16ToUTF8(profile_name).c_str()); | |
84 bool result = content::ExecuteScript(web_contents, launch_js); | |
85 EXPECT_TRUE(result); | |
86 base::RunLoop().RunUntilIdle(); | |
87 | |
88 content::WebContents* about_chrome_contents = | |
89 browser()->tab_strip_model()->GetActiveWebContents(); | |
90 GURL current_URL = about_chrome_contents->GetVisibleURL(); | |
91 EXPECT_EQ(GURL(chrome::kChromeUIUberURL), current_URL); | |
92 } | |
OLD | NEW |