| 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 | |
| 88 std::string chrome_prefix(content::kChromeUIScheme); | 85 std::string chrome_prefix(content::kChromeUIScheme); |
| 89 chrome_prefix.append(url::kStandardSchemeSeparator); | 86 chrome_prefix.append(url::kStandardSchemeSeparator); |
| 90 std::vector<AboutURLTestCase> test_cases( | 87 std::vector<AboutURLTestCase> test_cases( |
| 91 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost), | 88 {{GURL(chrome_prefix + chrome::kChromeUISettingsHost), |
| 92 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost)}, | 89 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost)}, |
| 93 {GURL(chrome_prefix + chrome::kChromeUIHelpHost), | 90 {GURL(chrome_prefix + chrome::kChromeUIHelpHost), |
| 94 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost + "/" + | 91 GURL(chrome_prefix + chrome::kChromeUISettingsFrameHost + "/" + |
| 95 chrome::kChromeUIHelpHost)}}); | 92 chrome::kChromeUIHelpHost)}}); |
| 96 TestWillHandleBrowserAboutURL(test_cases); | 93 TestWillHandleBrowserAboutURL(test_cases); |
| 97 } | 94 } |
| 98 | 95 |
| 99 #else | 96 #else |
| 100 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptions) { | 97 TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURLForOptions) { |
| 101 base::test::ScopedFeatureList scoped_feature_list; | |
| 102 scoped_feature_list.InitAndDisableFeature(features::kMaterialDesignSettings); | |
| 103 | |
| 104 std::string chrome_prefix(content::kChromeUIScheme); | 98 std::string chrome_prefix(content::kChromeUIScheme); |
| 105 chrome_prefix.append(url::kStandardSchemeSeparator); | 99 chrome_prefix.append(url::kStandardSchemeSeparator); |
| 106 std::vector<AboutURLTestCase> test_cases( | 100 std::vector<AboutURLTestCase> test_cases( |
| 107 {{ | 101 {{ |
| 108 GURL(chrome_prefix + chrome::kChromeUISettingsHost), | 102 GURL(chrome_prefix + chrome::kChromeUISettingsHost), |
| 109 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" + | 103 GURL(chrome_prefix + chrome::kChromeUIUberHost + "/" + |
| 110 chrome::kChromeUISettingsHost + "/"), | 104 chrome::kChromeUISettingsHost + "/"), |
| 111 }, | 105 }, |
| 112 { | 106 { |
| 113 GURL(chrome_prefix + chrome::kChromeUIHelpHost), | 107 GURL(chrome_prefix + chrome::kChromeUIHelpHost), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 144 GURL rewritten_url("http://foo/"); | 138 GURL rewritten_url("http://foo/"); |
| 145 | 139 |
| 146 TestingProfile profile; | 140 TestingProfile profile; |
| 147 std::unique_ptr<NavigationEntry> entry( | 141 std::unique_ptr<NavigationEntry> entry( |
| 148 NavigationController::CreateNavigationEntry( | 142 NavigationController::CreateNavigationEntry( |
| 149 url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(), | 143 url, Referrer(), ui::PAGE_TRANSITION_RELOAD, false, std::string(), |
| 150 &profile)); | 144 &profile)); |
| 151 EXPECT_EQ(fixed_url, entry->GetVirtualURL()); | 145 EXPECT_EQ(fixed_url, entry->GetVirtualURL()); |
| 152 EXPECT_EQ(rewritten_url, entry->GetURL()); | 146 EXPECT_EQ(rewritten_url, entry->GetURL()); |
| 153 } | 147 } |
| OLD | NEW |