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. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "chrome/browser/profiles/profile_window.h" | 10 #include "chrome/browser/profiles/profile_window.h" |
11 #include "chrome/browser/profiles/profiles_state.h" | 11 #include "chrome/browser/profiles/profiles_state.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
17 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
18 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
20 #include "components/signin/core/common/profile_management_switches.h" | 20 #include "components/signin/core/common/profile_management_switches.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/test/browser_test_utils.h" | 22 #include "content/public/test/browser_test_utils.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 | 24 |
25 class UserManagerUIBrowserTest : public InProcessBrowserTest, | 25 class UserManagerUIBrowserTest : public InProcessBrowserTest, |
26 public testing::WithParamInterface<bool> { | 26 public testing::WithParamInterface<bool> { |
27 public: | 27 public: |
28 UserManagerUIBrowserTest() {} | 28 UserManagerUIBrowserTest() {} |
29 | |
30 protected: | |
31 void SetUp() override { | |
32 InProcessBrowserTest::SetUp(); | |
33 DCHECK(switches::IsNewAvatarMenu()); | |
34 } | |
35 | |
36 void SetUpCommandLine(base::CommandLine* command_line) override { | |
37 switches::EnableNewAvatarMenuForTesting(command_line); | |
38 } | |
39 }; | 29 }; |
40 | 30 |
41 IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageLoads) { | 31 IN_PROC_BROWSER_TEST_F(UserManagerUIBrowserTest, PageLoads) { |
42 ui_test_utils::NavigateToURL( | 32 ui_test_utils::NavigateToURL( |
43 browser(), GURL(chrome::kChromeUIUserManagerURL)); | 33 browser(), GURL(chrome::kChromeUIUserManagerURL)); |
44 content::WebContents* web_contents = | 34 content::WebContents* web_contents = |
45 browser()->tab_strip_model()->GetActiveWebContents(); | 35 browser()->tab_strip_model()->GetActiveWebContents(); |
46 | 36 |
47 base::string16 title = web_contents->GetTitle(); | 37 base::string16 title = web_contents->GetTitle(); |
48 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), title); | 38 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), title); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::RunLoop().RunUntilIdle(); | 79 base::RunLoop().RunUntilIdle(); |
90 | 80 |
91 content::WebContents* about_chrome_contents = | 81 content::WebContents* about_chrome_contents = |
92 browser()->tab_strip_model()->GetActiveWebContents(); | 82 browser()->tab_strip_model()->GetActiveWebContents(); |
93 GURL current_URL = about_chrome_contents->GetVisibleURL(); | 83 GURL current_URL = about_chrome_contents->GetVisibleURL(); |
94 EXPECT_EQ(GURL(chrome::kChromeUIHelpURL), current_URL); | 84 EXPECT_EQ(GURL(chrome::kChromeUIHelpURL), current_URL); |
95 } | 85 } |
96 | 86 |
97 // TODO(mlerman): Test that unlocking a locked profile causes the extensions | 87 // TODO(mlerman): Test that unlocking a locked profile causes the extensions |
98 // service to become unblocked. | 88 // service to become unblocked. |
OLD | NEW |