Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
|
Dan Beam
2016/06/03 03:01:43
#include "base/feature_list.h"
groby-ooo-7-16
2016/06/06 20:11:59
Done.
| |
| 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_features.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 feature_list->InitializeFromCommandLine( | 98 feature_list->InitializeFromCommandLine( |
| 99 features::kMaterialDesignHistoryFeature.name, ""); | 99 features::kMaterialDesignHistoryFeature.name, ""); |
| 100 base::FeatureList::ClearInstanceForTesting(); | 100 base::FeatureList::ClearInstanceForTesting(); |
| 101 base::FeatureList::SetInstance(std::move(feature_list)); | 101 base::FeatureList::SetInstance(std::move(feature_list)); |
| 102 | 102 |
| 103 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); | 103 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); |
| 104 SelectTab(); | 104 SelectTab(); |
| 105 EXPECT_TRUE(GetJsBool("$('history').hidden")); | 105 EXPECT_TRUE(GetJsBool("$('history').hidden")); |
| 106 } | 106 } |
| 107 | 107 |
| 108 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, EnableMdSettingsHidesSettings) { | |
| 109 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
| 110 feature_list->InitializeFromCommandLine( | |
| 111 features::kMaterialDesignSettingsFeature.name, ""); | |
| 112 base::FeatureList::ClearInstanceForTesting(); | |
| 113 base::FeatureList::SetInstance(std::move(feature_list)); | |
| 114 | |
| 115 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); | |
| 116 SelectTab(); | |
| 117 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); | |
| 118 } | |
| 119 | |
| 108 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, | 120 IN_PROC_BROWSER_TEST_F(UberUIBrowserTest, |
| 109 EnableSettingsWindowHidesSettingsAndHelp) { | 121 EnableSettingsWindowHidesSettingsAndHelp) { |
| 110 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 122 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 111 ::switches::kEnableSettingsWindow); | 123 ::switches::kEnableSettingsWindow); |
| 112 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); | 124 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIUberFrameURL)); |
| 113 SelectTab(); | 125 SelectTab(); |
| 114 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); | 126 EXPECT_TRUE(GetJsBool("$('settings').hidden && $('help').hidden")); |
| 115 } | 127 } |
| OLD | NEW |