OLD | NEW |
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 Loading... |
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), |
(...skipping 30 matching lines...) Expand all Loading... |
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 } |
OLD | NEW |