Chromium Code Reviews| 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 using chrome::ChromeContentBrowserClient; | |
|
Alexei Svitkine (slow)
2012/08/02 22:00:11
Just put this test in the chrome namespace and get
| |
| 12 | |
| 13 class ChromeContentBrowserClientTest : public testing::Test { | |
|
Alexei Svitkine (slow)
2012/08/02 22:00:11
I don't think this is needed.
| |
| 14 }; | |
| 15 | |
| 16 TEST_F(ChromeContentBrowserClientTest, URLHandlers) { | |
| 17 ChromeContentBrowserClient client; | |
| 18 BrowserURLHandlerImpl* url_handler = BrowserURLHandlerImpl::GetInstance(); | |
| 19 TestingProfile profile; | |
| 20 | |
| 21 client.BrowserURLHandlerCreated(url_handler); | |
| 22 | |
| 23 const GURL test_url_original("chrome://settings/"); | |
| 24 const GURL test_url_rewritten("chrome://chrome/settings/"); | |
| 25 | |
| 26 GURL test_url = test_url_original; | |
| 27 bool needs_reverse = false; | |
| 28 | |
| 29 url_handler->RewriteURLIfNecessary(&test_url, &profile, &needs_reverse); | |
| 30 EXPECT_EQ(test_url_rewritten, test_url); | |
| 31 | |
| 32 url_handler->ReverseURLRewrite(&test_url, test_url_original, &profile); | |
| 33 EXPECT_EQ(test_url_original, test_url); | |
| 34 } | |
| OLD | NEW |