Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Side by Side Diff: chrome/browser/chrome_content_browser_client_unittest.cc

Issue 10780013: Add reverse URL handler for shortening uber URLs (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: added tests Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698