Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d7a6d5d87265cbb1d9770dde55b1fed15a9034c8 |
| --- /dev/null |
| +++ b/chrome/browser/chrome_content_browser_client_unittest.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/chrome_content_browser_client.h" |
| +#include "chrome/test/base/testing_profile.h" |
| +#include "content/browser/browser_url_handler_impl.h" |
| +#include "googleurl/src/gurl.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +using chrome::ChromeContentBrowserClient; |
|
Alexei Svitkine (slow)
2012/08/02 22:00:11
Just put this test in the chrome namespace and get
|
| + |
| +class ChromeContentBrowserClientTest : public testing::Test { |
|
Alexei Svitkine (slow)
2012/08/02 22:00:11
I don't think this is needed.
|
| +}; |
| + |
| +TEST_F(ChromeContentBrowserClientTest, URLHandlers) { |
| + ChromeContentBrowserClient client; |
| + BrowserURLHandlerImpl* url_handler = BrowserURLHandlerImpl::GetInstance(); |
| + TestingProfile profile; |
| + |
| + client.BrowserURLHandlerCreated(url_handler); |
| + |
| + const GURL test_url_original("chrome://settings/"); |
| + const GURL test_url_rewritten("chrome://chrome/settings/"); |
| + |
| + GURL test_url = test_url_original; |
| + bool needs_reverse = false; |
| + |
| + url_handler->RewriteURLIfNecessary(&test_url, &profile, &needs_reverse); |
| + EXPECT_EQ(test_url_rewritten, test_url); |
| + |
| + url_handler->ReverseURLRewrite(&test_url, test_url_original, &profile); |
| + EXPECT_EQ(test_url_original, test_url); |
| +} |