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

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: comments 3 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 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698