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

Unified Diff: content/browser/web_contents/navigation_controller_impl_unittest.cc

Issue 11428119: Merge 167856 - Ensure a transient entry is discarded on in-page navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/navigation_controller_impl_unittest.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl_unittest.cc (revision 170535)
+++ content/browser/web_contents/navigation_controller_impl_unittest.cc (working copy)
@@ -1971,6 +1971,7 @@
const GURL url1("http://foo/1");
const GURL url2("http://foo/2");
const GURL url3("http://foo/3");
+ const GURL url3_ref("http://foo/3#bar");
const GURL url4("http://foo/4");
const GURL transient_url("http://foo/transient");
@@ -2085,12 +2086,21 @@
test_rvh()->SendNavigate(3, url3);
EXPECT_EQ(url3, controller.GetVisibleEntry()->GetURL());
+ // Add a transient and do an in-page navigation, replacing the current entry.
+ transient_entry = new NavigationEntryImpl;
+ transient_entry->SetURL(transient_url);
+ controller.AddTransientEntry(transient_entry);
+ EXPECT_EQ(transient_url, controller.GetActiveEntry()->GetURL());
+ test_rvh()->SendNavigate(3, url3_ref);
+ // Transient entry should be gone.
+ EXPECT_EQ(url3_ref, controller.GetActiveEntry()->GetURL());
+
// Ensure the URLs are correct.
EXPECT_EQ(controller.GetEntryCount(), 5);
EXPECT_EQ(controller.GetEntryAtIndex(0)->GetURL(), url0);
EXPECT_EQ(controller.GetEntryAtIndex(1)->GetURL(), url1);
EXPECT_EQ(controller.GetEntryAtIndex(2)->GetURL(), url2);
- EXPECT_EQ(controller.GetEntryAtIndex(3)->GetURL(), url3);
+ EXPECT_EQ(controller.GetEntryAtIndex(3)->GetURL(), url3_ref);
EXPECT_EQ(controller.GetEntryAtIndex(4)->GetURL(), url4);
}
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698