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

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui_browsertest.cc

Issue 2511993002: Migrate md history test code to ScopedFeatureList. (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 <string> 5 #include <string>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/test/scoped_feature_list.h" 10 #include "base/test/scoped_feature_list.h"
11 #include "chrome/browser/extensions/extension_service.h" 11 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/test_extension_system.h" 12 #include "chrome/browser/extensions/test_extension_system.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/browser/ui/webui/md_history_ui.h"
17 #include "chrome/common/chrome_features.h" 16 #include "chrome/common/chrome_features.h"
18 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
20 #include "chrome/test/base/ui_test_utils.h" 19 #include "chrome/test/base/ui_test_utils.h"
21 #include "chrome/test/base/web_ui_browser_test.h" 20 #include "chrome/test/base/web_ui_browser_test.h"
22 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
23 #include "content/public/test/browser_test_utils.h" 22 #include "content/public/test/browser_test_utils.h"
24 #include "extensions/browser/extension_registry.h" 23 #include "extensions/browser/extension_registry.h"
25 #include "extensions/common/extension.h" 24 #include "extensions/common/extension.h"
26 #include "extensions/common/extension_builder.h" 25 #include "extensions/common/extension_builder.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) { 89 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) {
91 base::test::ScopedFeatureList scoped_feature_list; 90 base::test::ScopedFeatureList scoped_feature_list;
92 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignExtensions); 91 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignExtensions);
93 92
94 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 93 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
95 SelectTab(); 94 SelectTab();
96 EXPECT_TRUE(GetJsBool("$('extensions').hidden")); 95 EXPECT_TRUE(GetJsBool("$('extensions').hidden"));
97 } 96 }
98 97
99 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) { 98 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) {
100 MdHistoryUI::SetEnabledForTesting(true); 99 base::test::ScopedFeatureList scoped_feature_list;
100 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignHistory);
101 101
102 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 102 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
103 SelectTab(); 103 SelectTab();
104 EXPECT_TRUE(GetJsBool("$('history').hidden")); 104 EXPECT_TRUE(GetJsBool("$('history').hidden"));
105 } 105 }
106 106
107 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdSettingsHidesSettings) { 107 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdSettingsHidesSettings) {
108 base::test::ScopedFeatureList scoped_feature_list; 108 base::test::ScopedFeatureList scoped_feature_list;
109 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignSettings); 109 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignSettings);
110 110
111 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 111 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
112 SelectTab(); 112 SelectTab();
113 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); 113 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden"));
114 } 114 }
115 115
116 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, 116 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest,
117 EnableSettingsWindowHidesSettingsAndHelp) { 117 EnableSettingsWindowHidesSettingsAndHelp) {
118 base::CommandLine::ForCurrentProcess()->AppendSwitch( 118 base::CommandLine::ForCurrentProcess()->AppendSwitch(
119 ::switches::kEnableSettingsWindow); 119 ::switches::kEnableSettingsWindow);
120 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 120 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
121 SelectTab(); 121 SelectTab();
122 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); 122 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden"));
123 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698