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

Side by Side Diff: chrome/browser/browser_about_handler_unittest.cc

Issue 2699973002: MD Settings: enable by default in client (Closed)
Patch Set: test fixes? Created 3 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 GURL(chrome_prefix + "host/path?query#ref"), 75 GURL(chrome_prefix + "host/path?query#ref"),
76 GURL(chrome_prefix + "host/path?query#ref"), 76 GURL(chrome_prefix + "host/path?query#ref"),
77 }}); 77 }});
78 TestWillHandleBrowserAboutURL(test_cases); 78 TestWillHandleBrowserAboutURL(test_cases);
79 } 79 }
80 80
81 #if defined(OS_CHROMEOS) 81 #if defined(OS_CHROMEOS)
82 // Chrome OS defaults to showing Options in a window and including About in 82 // Chrome OS defaults to showing Options in a window and including About in
83 // Options. 83 // Options.
84 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptionsChromeOS) { 84 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptionsChromeOS) {
85 base::test::ScopedFeatureList scoped_feature_list;
86 scoped_feature_list.InitAndDisableFeature(features::kMaterialDesignSettings);
87
85 std::string chrome_prefix(content::kChromeUIScheme); 88 std::string chrome_prefix(content::kChromeUIScheme);
86 chrome_prefix.append(url::kStandardSchemeSeparator); 89 chrome_prefix.append(url::kStandardSchemeSeparator);
87 std::vector<AboutURLTestCase> test_cases( 90 std::vector<AboutURLTestCase> test_cases(
88 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost), 91 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost),
89 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost)}, 92 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost)},
90 {GURL(chrome_prefix + chrome::kChromeUIHelpHost), 93 {GURL(chrome_prefix + chrome::kChromeUIHelpHost),
91 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost + "/" + 94 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost + "/" +
92 chrome::kChromeUIHelpHost)}}); 95 chrome::kChromeUIHelpHost)}});
93 TestWillHandleBrowserAboutURL(test_cases); 96 TestWillHandleBrowserAboutURL(test_cases);
94 } 97 }
95 98
96 #else 99 #else
97 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptions) { 100 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptions) {
101 base::test::ScopedFeatureList scoped_feature_list;
102 scoped_feature_list.InitAndDisableFeature(features::kMaterialDesignSettings);
103
98 std::string chrome_prefix(content::kChromeUIScheme); 104 std::string chrome_prefix(content::kChromeUIScheme);
99 chrome_prefix.append(url::kStandardSchemeSeparator); 105 chrome_prefix.append(url::kStandardSchemeSeparator);
100 std::vector<AboutURLTestCase> test_cases( 106 std::vector<AboutURLTestCase> test_cases(
101 {{ 107 {{
102 GURL(chrome_prefix + chrome::kChromeUISettingsHost), 108 GURL(chrome_prefix + chrome::kChromeUISettingsHost),
103 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" + 109 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" +
104 chrome::kChromeUISettingsHost + "/"), 110 chrome::kChromeUISettingsHost + "/"),
105 }, 111 },
106 { 112 {
107 GURL(chrome_prefix + chrome::kChromeUIHelpHost), 113 GURL(chrome_prefix + chrome::kChromeUIHelpHost),
108 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" + 114 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" +
109 chrome::kChromeUIHelpHost + "/"), 115 chrome::kChromeUIHelpHost + "/"),
110 }}); 116 }});
111 TestWillHandleBrowserAboutURL(test_cases); 117 TestWillHandleBrowserAboutURL(test_cases);
112 } 118 }
113 #endif 119 #endif
114 120
115 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForMDSettings) { 121 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForMDSettings) {
Dan Beam 2017/02/17 03:22:18 has an MD version
116 base::test::ScopedFeatureList scoped_feature_list; 122 base::test::ScopedFeatureList scoped_feature_list;
117 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignSettings); 123 scoped_feature_list.InitAndEnableFeature(features::kMaterialDesignSettings);
118 124
119 std::string chrome_prefix(content::kChromeUIScheme); 125 std::string chrome_prefix(content::kChromeUIScheme);
120 chrome_prefix.append(url::kStandardSchemeSeparator); 126 chrome_prefix.append(url::kStandardSchemeSeparator);
121 std::vector<AboutURLTestCase> test_cases( 127 std::vector<AboutURLTestCase> test_cases(
122 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost), 128 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost),
123 GURL(chrome_prefix + chrome::kChromeUISettingsHost)}}); 129 GURL(chrome_prefix + chrome::kChromeUISettingsHost)}});
124 TestWillHandleBrowserAboutURL(test_cases); 130 TestWillHandleBrowserAboutURL(test_cases);
125 } 131 }
(...skipping 12 matching lines...) Expand all
138 GURL rewritten_url("http://foo/"); 144 GURL rewritten_url("http://foo/");
139 145
140 TestingProfile profile; 146 TestingProfile profile;
141 std::unique_ptr<NavigationEntry> entry( 147 std::unique_ptr<NavigationEntry> entry(
142 NavigationController::CreateNavigationEntry( 148 NavigationController::CreateNavigationEntry(
143 url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(), 149 url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(),
144 &profile)); 150 &profile));
145 EXPECT_EQ(fixed_url, entry->GetVirtualURL()); 151 EXPECT_EQ(fixed_url, entry->GetVirtualURL());
146 EXPECT_EQ(rewritten_url, entry->GetURL()); 152 EXPECT_EQ(rewritten_url, entry->GetURL());
147 } 153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698