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

Unified Diff: content/browser/tab_contents/navigation_controller_unittest.cc

Issue 7649009: Merge of 97624 to 835 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/tab_contents/navigation_controller.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/navigation_controller_unittest.cc
===================================================================
--- content/browser/tab_contents/navigation_controller_unittest.cc (revision 96734)
+++ content/browser/tab_contents/navigation_controller_unittest.cc (working copy)
@@ -1847,6 +1847,9 @@
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
other_contents->NavigateAndCommit(url3);
+ other_contents->ExpectSetHistoryLengthAndPrune(
+ other_controller.GetEntryAtIndex(0)->site_instance(), 2,
+ other_controller.GetEntryAtIndex(0)->page_id());
other_controller.CopyStateFromAndPrune(&controller(), false);
// other_controller should now contain the 3 urls: url1, url2 and url3.
@@ -1873,6 +1876,7 @@
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
+ other_contents->ExpectSetHistoryLengthAndPrune(NULL, 1, -1);
other_controller.CopyStateFromAndPrune(&controller(), false);
// other_controller should now contain the 1 url: url1.
@@ -1898,6 +1902,7 @@
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
other_controller.LoadURL(url3, GURL(), PageTransition::TYPED);
+ other_contents->ExpectSetHistoryLengthAndPrune(NULL, 1, -1);
other_controller.CopyStateFromAndPrune(&controller(), false);
// other_controller should now contain 1 entry for url1, and a pending entry
@@ -1924,6 +1929,7 @@
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
+ other_contents->ExpectSetHistoryLengthAndPrune(NULL, 1, -1);
other_controller.CopyStateFromAndPrune(&controller(), true);
// other_controller should now contain 1 entry for url1.
@@ -1949,6 +1955,10 @@
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
other_contents->NavigateAndCommit(url2);
+ other_contents->ExpectSetHistoryLengthAndPrune(
+ other_controller.GetEntryAtIndex(0)->site_instance(),
+ 1,
+ other_controller.GetEntryAtIndex(0)->page_id() + 1);
other_controller.CopyStateFromAndPrune(&controller(), true);
// other_controller should now contain 1 entry, url1.
@@ -1974,6 +1984,10 @@
NavigationController& other_controller = other_contents->controller();
other_contents->NavigateAndCommit(url2);
other_controller.LoadURL(url3, GURL(), PageTransition::TYPED);
+ other_contents->ExpectSetHistoryLengthAndPrune(
+ other_controller.GetEntryAtIndex(0)->site_instance(),
+ 1,
+ other_controller.GetEntryAtIndex(0)->page_id() + 1);
other_controller.CopyStateFromAndPrune(&controller(), true);
// other_controller should now contain 2 entries: url1, and url3.
« no previous file with comments | « content/browser/tab_contents/navigation_controller.cc ('k') | content/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698