| 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..875fa27f42deae5010c6663d201b3f191342720c
|
| --- /dev/null
|
| +++ b/chrome/browser/chrome_content_browser_client_unittest.cc
|
| @@ -0,0 +1,33 @@
|
| +// 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"
|
| +
|
| +namespace chrome {
|
| +
|
| +TEST(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);
|
| +}
|
| +
|
| +} // namespace chrome
|
|
|