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

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

Issue 2957783002: Fix wrong ui::PAGE_TRANSITION_FORWARD_BACK in tests. (Closed)
Patch Set: Created 3 years, 6 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
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 995b962113ba0e412073d8ade722798f80e9dfff..70b86b9f80ad90ccd108f3259b86f303a6919320 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -860,7 +860,8 @@ TEST_F(WebContentsImplTest, NavigateFromRestoredSitelessUrl) {
ASSERT_EQ(0u, entries.size());
ASSERT_EQ(1, controller().GetEntryCount());
- controller().GoToIndex(0);
+ EXPECT_TRUE(controller().NeedsReload());
+ controller().LoadIfNecessary();
NavigationEntry* entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), false,
@@ -909,7 +910,8 @@ TEST_F(WebContentsImplTest, NavigateFromRestoredRegularUrl) {
ASSERT_EQ(0u, entries.size());
ASSERT_EQ(1, controller().GetEntryCount());
- controller().GoToIndex(0);
+ EXPECT_TRUE(controller().NeedsReload());
+ controller().LoadIfNecessary();
NavigationEntry* entry = controller().GetPendingEntry();
orig_rfh->PrepareForCommit();
contents()->TestDidNavigate(orig_rfh, entry->GetUniqueID(), false,
@@ -1467,8 +1469,9 @@ TEST_F(WebContentsImplTest, NavigationEntryContentState) {
controller().GoBack();
entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, entry_id, false, url,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigate(
+ orig_rfh, entry_id, false, url,
+ controller().GetPendingEntry()->GetTransitionType());
entry = controller().GetLastCommittedEntry();
EXPECT_TRUE(entry->GetPageState().IsValid());
}

Powered by Google App Engine
This is Rietveld 408576698