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

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

Issue 6155003: Changes instant so that the newly created tab has a new id. Doing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « chrome/browser/tab_contents/navigation_controller.cc ('k') | chrome/browser/tabs/default_tab_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/navigation_controller_unittest.cc
diff --git a/chrome/browser/tab_contents/navigation_controller_unittest.cc b/chrome/browser/tab_contents/navigation_controller_unittest.cc
index 91c23eaaffe3f09635636e053f1fe8961323f0ed..1935457e58a6e5476b28f71ea40694204fa27dcb 100644
--- a/chrome/browser/tab_contents/navigation_controller_unittest.cc
+++ b/chrome/browser/tab_contents/navigation_controller_unittest.cc
@@ -1725,6 +1725,7 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune) {
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
+ SessionID other_id(other_controller.session_id());
other_contents->NavigateAndCommit(url3);
other_controller.CopyStateFromAndPrune(&controller());
@@ -1738,10 +1739,9 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune) {
EXPECT_EQ(url2, other_controller.GetEntryAtIndex(1)->url());
EXPECT_EQ(url3, other_controller.GetEntryAtIndex(2)->url());
- // The session id of the new tab should be that of the old, and the old should
- // get a new id.
- EXPECT_EQ(id.id(), other_controller.session_id().id());
- EXPECT_NE(id.id(), controller().session_id().id());
+ // Make sure session ids didn't change.
+ EXPECT_EQ(id.id(), controller().session_id().id());
+ EXPECT_EQ(other_id.id(), other_controller.session_id().id());
}
// Test CopyStateFromAndPrune with 2 urls, the first selected and nothing in
@@ -1758,6 +1758,7 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune2) {
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
+ SessionID other_id(other_controller.session_id());
other_controller.CopyStateFromAndPrune(&controller());
// other_controller should now contain the 1 url: url1.
@@ -1768,10 +1769,9 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune2) {
EXPECT_EQ(url1, other_controller.GetEntryAtIndex(0)->url());
- // The session id of the new tab should be that of the old, and the old should
- // get a new id.
- EXPECT_EQ(id.id(), other_controller.session_id().id());
- EXPECT_NE(id.id(), controller().session_id().id());
+ // Make sure session ids didn't change.
+ EXPECT_EQ(id.id(), controller().session_id().id());
+ EXPECT_EQ(other_id.id(), other_controller.session_id().id());
}
// Test CopyStateFromAndPrune with 2 urls, the first selected and nothing in
@@ -1788,6 +1788,7 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune3) {
scoped_ptr<TestTabContents> other_contents(CreateTestTabContents());
NavigationController& other_controller = other_contents->controller();
+ SessionID other_id(other_controller.session_id());
other_controller.LoadURL(url3, GURL(), PageTransition::TYPED);
other_controller.CopyStateFromAndPrune(&controller());
@@ -1805,10 +1806,9 @@ TEST_F(NavigationControllerTest, CopyStateFromAndPrune3) {
EXPECT_EQ(url3, other_controller.pending_entry()->url());
- // The session id of the new tab should be that of the old, and the old should
- // be get a new id.
- EXPECT_EQ(id.id(), other_controller.session_id().id());
- EXPECT_NE(id.id(), controller().session_id().id());
+ // Make sure session ids didn't change.
+ EXPECT_EQ(id.id(), controller().session_id().id());
+ EXPECT_EQ(other_id.id(), other_controller.session_id().id());
}
// Tests that navigations initiated from the page (with the history object)
« no previous file with comments | « chrome/browser/tab_contents/navigation_controller.cc ('k') | chrome/browser/tabs/default_tab_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698