| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } // namespace content | 343 } // namespace content |
| 344 #endif // !defined(OS_ANDROID) | 344 #endif // !defined(OS_ANDROID) |
| 345 | 345 |
| 346 class ChromeContentBrowserClientGetLoggingFileTest : public testing::Test {}; | 346 class ChromeContentBrowserClientGetLoggingFileTest : public testing::Test {}; |
| 347 | 347 |
| 348 TEST_F(ChromeContentBrowserClientGetLoggingFileTest, GetLoggingFile) { | 348 TEST_F(ChromeContentBrowserClientGetLoggingFileTest, GetLoggingFile) { |
| 349 ChromeContentBrowserClient client; | 349 ChromeContentBrowserClient client; |
| 350 base::FilePath log_file_name; | 350 base::FilePath log_file_name; |
| 351 EXPECT_FALSE(client.GetLoggingFileName().empty()); | 351 EXPECT_FALSE(client.GetLoggingFileName().empty()); |
| 352 } | 352 } |
| 353 |
| 354 class TestChromeContentBrowserClient : public ChromeContentBrowserClient { |
| 355 public: |
| 356 using ChromeContentBrowserClient::HandleWebUI; |
| 357 using ChromeContentBrowserClient::HandleWebUIReverse; |
| 358 }; |
| 359 |
| 360 TEST(ChromeContentBrowserClientTest, HandleWebUI) { |
| 361 TestChromeContentBrowserClient test_content_browser_client; |
| 362 const GURL http_help("http://help/"); |
| 363 GURL should_not_redirect = http_help; |
| 364 test_content_browser_client.HandleWebUI(&should_not_redirect, nullptr); |
| 365 EXPECT_EQ(http_help, should_not_redirect); |
| 366 |
| 367 const GURL chrome_help("chrome://help/"); |
| 368 GURL should_redirect = chrome_help; |
| 369 test_content_browser_client.HandleWebUI(&should_redirect, nullptr); |
| 370 EXPECT_NE(chrome_help, should_redirect); |
| 371 } |
| 372 |
| 373 TEST(ChromeContentBrowserClientTest, HandleWebUIReverse) { |
| 374 TestChromeContentBrowserClient test_content_browser_client; |
| 375 GURL http_settings("http://settings/"); |
| 376 EXPECT_FALSE( |
| 377 test_content_browser_client.HandleWebUIReverse(&http_settings, nullptr)); |
| 378 GURL chrome_settings("chrome://settings/"); |
| 379 EXPECT_TRUE(test_content_browser_client.HandleWebUIReverse(&chrome_settings, |
| 380 nullptr)); |
| 381 } |
| OLD | NEW |