diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 23:01:51 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 23:01:51 +0000 |
commit | 6dfdc020fa65c8ad5840ccb6c78021a578be8843 (patch) | |
tree | a1121f6713ec1be2b57f28527c41f436967905b9 /chrome/browser/sessions | |
parent | a9dc9130e3612bb613575c4ae210148d1fbb5157 (diff) | |
download | chromium_src-6dfdc020fa65c8ad5840ccb6c78021a578be8843.zip chromium_src-6dfdc020fa65c8ad5840ccb6c78021a578be8843.tar.gz chromium_src-6dfdc020fa65c8ad5840ccb6c78021a578be8843.tar.bz2 |
Don't create pending entries when a navigation is initiated by the page.
If the page reloads while such a navigation happens, we could end up with the wrong pending entry.
Also make sure TestTabContents::NavigateAndCommit() does commit on the right RVH.
BUG=51680
TEST=See bug for steps.
Review URL: http://codereview.chromium.org/3257002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r-- | chrome/browser/sessions/tab_restore_service_browsertest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/sessions/tab_restore_service_browsertest.cc b/chrome/browser/sessions/tab_restore_service_browsertest.cc index dcbd688..46f91e8 100644 --- a/chrome/browser/sessions/tab_restore_service_browsertest.cc +++ b/chrome/browser/sessions/tab_restore_service_browsertest.cc @@ -9,6 +9,7 @@ #include "chrome/browser/sessions/tab_restore_service.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/navigation_entry.h" +#include "chrome/browser/tab_contents/test_tab_contents.h" #include "chrome/test/render_view_test.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" @@ -68,8 +69,7 @@ class TabRestoreServiceTest : public RenderViewHostTestHarness { // Navigate back. We have to do this song and dance as NavigationController // isn't happy if you navigate immediately while going back. controller().GoToIndex(index); - rvh()->SendNavigate(controller().pending_entry()->page_id(), - controller().pending_entry()->url()); + contents()->CommitPendingNavigation(); } void RecreateService() { @@ -157,9 +157,9 @@ TEST_F(TabRestoreServiceTest, Basic) { tab = static_cast<TabRestoreService::Tab*>(entry); EXPECT_FALSE(tab->pinned); ASSERT_EQ(3U, tab->navigations.size()); - EXPECT_TRUE(url1_ == tab->navigations[0].virtual_url()); - EXPECT_TRUE(url2_ == tab->navigations[1].virtual_url()); - EXPECT_TRUE(url3_ == tab->navigations[2].virtual_url()); + EXPECT_EQ(url1_, tab->navigations[0].virtual_url()); + EXPECT_EQ(url2_, tab->navigations[1].virtual_url()); + EXPECT_EQ(url3_, tab->navigations[2].virtual_url()); EXPECT_EQ(1, tab->current_navigation_index); EXPECT_EQ(time_factory_->TimeNow().ToInternalValue(), tab->timestamp.ToInternalValue()); |