summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 19:08:48 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 19:08:48 +0000
commita0e692672ede62f71cfaa159cfd90990cb3f860a (patch)
tree1993221296b00b18d9c073b4aa5d092d35b7f993 /chrome/browser/history
parentc533bb2982bb58ca7cd8d586bc0bc35e2e7f08ed (diff)
downloadchromium_src-a0e692672ede62f71cfaa159cfd90990cb3f860a.zip
chromium_src-a0e692672ede62f71cfaa159cfd90990cb3f860a.tar.gz
chromium_src-a0e692672ede62f71cfaa159cfd90990cb3f860a.tar.bz2
Fix NavigationController::ClassifyNavigation() to treat redirection correctly.
When we enter an address that redirects to some other page to the address box, it should show the address where we are redirected to after navigation completes. Currently, it doesn't when we follow this procedure more than once as described in BUG 5374. After redirection, the renderer says that it navigated to the same page by returning existing page_id in ViewHostMsg_FrameNavigate_Params, but NavigationController::ClassifyNavigation() compares params.url with pending_entry_->url() and says it's not SAME_PAGE. Therefore, the result is not correctly treated and goes into EXISTING_PAGE handler. It compares the existing entry for the page with pending_entry_. It's false, so it doesn't call DiscardNonCommittedEntriesInternal(). pending_entry_ left not released. Toolbar's view uses this pending_entry_'s url for showing address on the address bar. We should not check URL. Just overwrite entry_ with the response from renderer. TEST= Access http://www.google.com , https://www.google.com , and then https://www.google.com . The address bar should show http://www.google.com . Prepare some site http://example.com which redirects to http://example.org , and then access http://example.com , and then change the redirection to http://example.net . Retry accessing http://example.com . The address bar should show http://example.net . BUG=5374 Original review: http://codereview.chromium.org/115916 Patch by tyoshino@google.com git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/redirect_uitest.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc
index 301acc3..7f3e7be 100644
--- a/chrome/browser/history/redirect_uitest.cc
+++ b/chrome/browser/history/redirect_uitest.cc
@@ -71,6 +71,19 @@ TEST_F(RedirectTest, Client) {
ASSERT_EQ(1U, redirects.size());
EXPECT_EQ(final_url.spec(), redirects[0].spec());
+
+ // The address bar should display the final URL.
+ GURL tab_url;
+ EXPECT_TRUE(tab_proxy->GetCurrentURL(&tab_url));
+ EXPECT_TRUE(final_url == tab_url);
+
+ // Navigate one more time.
+ NavigateToURL(first_url);
+ PlatformThread::Sleep(action_timeout_ms());
+
+ // The address bar should still display the final URL.
+ EXPECT_TRUE(tab_proxy->GetCurrentURL(&tab_url));
+ EXPECT_TRUE(final_url == tab_url);
}
TEST_F(RedirectTest, ClientEmptyReferer) {