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

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

Issue 1766273002: Convert --enable-md-history to a feature flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move a feature override for kMaterialDesignHistoryFeature from SetUpCommandLine() to the inner scop… Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | 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 "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/extensions/test_extension_system.h" 11 #include "chrome/browser/extensions/test_extension_system.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" 14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
17 #include "chrome/test/base/ui_test_utils.h" 17 #include "chrome/test/base/ui_test_utils.h"
18 #include "chrome/test/base/web_ui_browser_test.h" 18 #include "chrome/test/base/web_ui_browser_test.h"
19 #include "content/public/common/content_switches.h"
19 #include "content/public/test/browser_test_utils.h" 20 #include "content/public/test/browser_test_utils.h"
20 #include "extensions/browser/extension_registry.h" 21 #include "extensions/browser/extension_registry.h"
21 #include "extensions/common/extension.h" 22 #include "extensions/common/extension.h"
22 #include "extensions/common/extension_builder.h" 23 #include "extensions/common/extension_builder.h"
23 24
24 class UberUIBrowserTest : public WebUIBrowserTest { 25 class UberUIBrowserTest : public WebUIBrowserTest {
25 public: 26 public:
26 UberUIBrowserTest() {} 27 UberUIBrowserTest() {}
27 ~UberUIBrowserTest() override {} 28 ~UberUIBrowserTest() override {}
28 29
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 86
86 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) { 87 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) {
87 base::CommandLine::ForCurrentProcess()->AppendSwitch( 88 base::CommandLine::ForCurrentProcess()->AppendSwitch(
88 ::switches::kEnableMaterialDesignExtensions); 89 ::switches::kEnableMaterialDesignExtensions);
89 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 90 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
90 SelectTab(); 91 SelectTab();
91 EXPECT_TRUE(GetJsBool("$('extensions').hidden")); 92 EXPECT_TRUE(GetJsBool("$('extensions').hidden"));
92 } 93 }
93 94
94 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) { 95 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) {
95 base::CommandLine::ForCurrentProcess()->AppendSwitch( 96 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
tsergeant 2016/03/10 05:23:35 This bit looks good to me.
96 ::switches::kEnableMaterialDesignHistory); 97 feature_list->InitializeFromCommandLine(
98 ::switches::kMaterialDesignHistoryFeature.name, "");
99 base::FeatureList::ClearInstanceForTesting();
100 base::FeatureList::SetInstance(std::move(feature_list));
101
97 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 102 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
98 SelectTab(); 103 SelectTab();
99 EXPECT_TRUE(GetJsBool("$('history').hidden")); 104 EXPECT_TRUE(GetJsBool("$('history').hidden"));
100 } 105 }
101 106
102 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, 107 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest,
103 EnableSettingsWindowHidesSettingsAndHelp) { 108 EnableSettingsWindowHidesSettingsAndHelp) {
104 base::CommandLine::ForCurrentProcess()->AppendSwitch( 109 base::CommandLine::ForCurrentProcess()->AppendSwitch(
105 ::switches::kEnableSettingsWindow); 110 ::switches::kEnableSettingsWindow);
106 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 111 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
107 SelectTab(); 112 SelectTab();
108 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); 113 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden"));
109 } 114 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698