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

Unified Diff: chrome/browser/chrome_content_browser_client_unittest.cc

Issue 2949053004: MD Settings: fix help/ redirection to only happen on chrome://help (Closed)
Patch Set: whoops Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client_unittest.cc
diff --git a/chrome/browser/chrome_content_browser_client_unittest.cc b/chrome/browser/chrome_content_browser_client_unittest.cc
index 53548f696a9d6d1bdd1c8d0f4d926b420d343cda..30df99e482ee241d7b86dbd5e8c1e538898e8c5e 100644
--- a/chrome/browser/chrome_content_browser_client_unittest.cc
+++ b/chrome/browser/chrome_content_browser_client_unittest.cc
@@ -350,3 +350,32 @@ TEST_F(ChromeContentBrowserClientGetLoggingFileTest, GetLoggingFile) {
base::FilePath log_file_name;
EXPECT_FALSE(client.GetLoggingFileName().empty());
}
+
+class TestChromeContentBrowserClient : public ChromeContentBrowserClient {
+ public:
+ using ChromeContentBrowserClient::HandleWebUI;
+ using ChromeContentBrowserClient::HandleWebUIReverse;
+};
+
+TEST(ChromeContentBrowserClientTest, HandleWebUI) {
+ TestChromeContentBrowserClient test_content_browser_client;
+ const GURL http_help("http://help/");
+ GURL should_not_redirect = http_help;
+ test_content_browser_client.HandleWebUI(&should_not_redirect, nullptr);
+ EXPECT_EQ(http_help, should_not_redirect);
+
+ const GURL chrome_help("chrome://help/");
+ GURL should_redirect = chrome_help;
+ test_content_browser_client.HandleWebUI(&should_redirect, nullptr);
+ EXPECT_NE(chrome_help, should_redirect);
+}
+
+TEST(ChromeContentBrowserClientTest, HandleWebUIReverse) {
+ TestChromeContentBrowserClient test_content_browser_client;
+ GURL http_settings("http://settings/");
+ EXPECT_FALSE(
+ test_content_browser_client.HandleWebUIReverse(&http_settings, nullptr));
+ GURL chrome_settings("chrome://settings/");
+ EXPECT_TRUE(test_content_browser_client.HandleWebUIReverse(&chrome_settings,
+ nullptr));
+}
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698