diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 02:37:40 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-02 02:37:40 +0000 |
commit | 79845effcd569cb61784e8a8c221f839e6e23525 (patch) | |
tree | d86e942097765499876b48a5d764592e2b9c376f /chrome/browser/tab_contents | |
parent | 9902c201466fe4a701f43a124f4d22b6829c87e6 (diff) | |
download | chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.zip chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.tar.gz chromium_src-79845effcd569cb61784e8a8c221f839e6e23525.tar.bz2 |
Strip the trailing slash from URLs like "http://google.com/". This especially helps when the scheme has also been stripped, as it makes the hostname look less unbalanced. We're careful to avoid stripping the slash when doing so would confuse the omnibox.
This also moves to more aggressive stripping and/or unescaping in several places. In general, it seems like we should be as aggressive as is feasible.
BUG=43587
TEST=Visit google.com. There should be no slash in the address bar.
Review URL: http://codereview.chromium.org/2389002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
3 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc index 658cbee..b60db13 100644 --- a/chrome/browser/tab_contents/navigation_controller_unittest.cc +++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc @@ -1623,8 +1623,8 @@ TEST_F(NavigationControllerTest, SameSubframe) { // Test view source redirection is reflected in title bar. TEST_F(NavigationControllerTest, ViewSourceRedirect) { const char kUrl[] = "view-source:http://redirect.to/google.com"; - const char kResult[] = "http://google.com/"; - const char kExpected[] = "view-source:http://google.com/"; + const char kResult[] = "http://google.com"; + const char kExpected[] = "view-source:http://google.com"; const GURL url(kUrl); const GURL result_url(kResult); diff --git a/chrome/browser/tab_contents/navigation_entry_unittest.cc b/chrome/browser/tab_contents/navigation_entry_unittest.cc index d742d3e..4ecd1df 100644 --- a/chrome/browser/tab_contents/navigation_entry_unittest.cc +++ b/chrome/browser/tab_contents/navigation_entry_unittest.cc @@ -57,8 +57,8 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) { // Setting URL affects virtual_url and GetTitleForDisplay entry1_.get()->set_url(GURL("http://www.google.com")); EXPECT_EQ(GURL("http://www.google.com"), entry1_.get()->url()); - EXPECT_EQ(GURL("http://www.google.com/"), entry1_.get()->virtual_url()); - EXPECT_EQ(ASCIIToUTF16("http://www.google.com/"), + EXPECT_EQ(GURL("http://www.google.com"), entry1_.get()->virtual_url()); + EXPECT_EQ(ASCIIToUTF16("www.google.com"), entry1_.get()->GetTitleForDisplay(NULL)); // Title affects GetTitleForDisplay diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index 9e95563..682aac6 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -233,7 +233,7 @@ TEST_F(TabContentsTest, UpdateTitle) { // Test view source mode for the new tabs page. TEST_F(TabContentsTest, NTPViewSource) { - const char kUrl[] = "view-source:chrome://newtab/"; + const char kUrl[] = "view-source:chrome://newtab"; const GURL kGURL(kUrl); process()->sink().ClearMessages(); |