| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 #include "chrome/test/base/testing_profile.h" |
| 7 #include "content/browser/browser_url_handler_impl.h" |
| 8 #include "googleurl/src/gurl.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 |
| 11 namespace chrome { |
| 12 |
| 13 TEST(ChromeContentBrowserClientTest, URLHandlers) { |
| 14 ChromeContentBrowserClient client; |
| 15 BrowserURLHandlerImpl* url_handler = BrowserURLHandlerImpl::GetInstance(); |
| 16 TestingProfile profile; |
| 17 |
| 18 client.BrowserURLHandlerCreated(url_handler); |
| 19 |
| 20 const GURL test_url_original("chrome://settings/"); |
| 21 const GURL test_url_rewritten("chrome://chrome/settings/"); |
| 22 |
| 23 GURL test_url = test_url_original; |
| 24 bool needs_reverse = false; |
| 25 |
| 26 url_handler->RewriteURLIfNecessary(&test_url, &profile, &needs_reverse); |
| 27 EXPECT_EQ(test_url_rewritten, test_url); |
| 28 |
| 29 url_handler->ReverseURLRewrite(&test_url, test_url_original, &profile); |
| 30 EXPECT_EQ(test_url_original, test_url); |
| 31 } |
| 32 |
| 33 } // namespace chrome |
| OLD | NEW |