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

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: Sync to the latest update and resolve a merge conflict 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/ui/webui/uber/uber_ui.cc ('k') | chrome/common/chrome_features.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_features.h"
15 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
16 #include "chrome/common/url_constants.h" 17 #include "chrome/common/url_constants.h"
17 #include "chrome/test/base/ui_test_utils.h" 18 #include "chrome/test/base/ui_test_utils.h"
18 #include "chrome/test/base/web_ui_browser_test.h" 19 #include "chrome/test/base/web_ui_browser_test.h"
20 #include "content/public/common/content_switches.h"
19 #include "content/public/test/browser_test_utils.h" 21 #include "content/public/test/browser_test_utils.h"
20 #include "extensions/browser/extension_registry.h" 22 #include "extensions/browser/extension_registry.h"
21 #include "extensions/common/extension.h" 23 #include "extensions/common/extension.h"
22 #include "extensions/common/extension_builder.h" 24 #include "extensions/common/extension_builder.h"
23 25
24 class UberUIBrowserTest : public WebUIBrowserTest { 26 class UberUIBrowserTest : public WebUIBrowserTest {
25 public: 27 public:
26 UberUIBrowserTest() {} 28 UberUIBrowserTest() {}
27 ~UberUIBrowserTest() override {} 29 ~UberUIBrowserTest() override {}
28 30
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 87
86 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) { 88 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdExtensionsHidesExtensions) {
87 base::CommandLine::ForCurrentProcess()->AppendSwitch( 89 base::CommandLine::ForCurrentProcess()->AppendSwitch(
88 ::switches::kEnableMaterialDesignExtensions); 90 ::switches::kEnableMaterialDesignExtensions);
89 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 91 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
90 SelectTab(); 92 SelectTab();
91 EXPECT_TRUE(GetJsBool("$('extensions').hidden")); 93 EXPECT_TRUE(GetJsBool("$('extensions').hidden"));
92 } 94 }
93 95
94 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) { 96 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdHistoryHidesHistory) {
95 base::CommandLine::ForCurrentProcess()->AppendSwitch( 97 scoped_ptr<base::FeatureList> feature_list(new base::FeatureList);
96 ::switches::kEnableMaterialDesignHistory); 98 feature_list->InitializeFromCommandLine(
99 features::kMaterialDesignHistoryFeature.name, "");
100 base::FeatureList::ClearInstanceForTesting();
101 base::FeatureList::SetInstance(std::move(feature_list));
102
97 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 103 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
98 SelectTab(); 104 SelectTab();
99 EXPECT_TRUE(GetJsBool("$('history').hidden")); 105 EXPECT_TRUE(GetJsBool("$('history').hidden"));
100 } 106 }
101 107
102 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, 108 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest,
103 EnableSettingsWindowHidesSettingsAndHelp) { 109 EnableSettingsWindowHidesSettingsAndHelp) {
104 base::CommandLine::ForCurrentProcess()->AppendSwitch( 110 base::CommandLine::ForCurrentProcess()->AppendSwitch(
105 ::switches::kEnableSettingsWindow); 111 ::switches::kEnableSettingsWindow);
106 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); 112 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL));
107 SelectTab(); 113 SelectTab();
108 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); 114 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden"));
109 } 115 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.cc ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698