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

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

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Allow renderer-initiated reloads. Created 3 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
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 8ba2b0522f53ff633709f2e7f39b5d4d57133d65..7b0b2c8894f142d022a25ae0054535a04bdfe326 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -520,8 +520,9 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
int entry_id = controller().GetPendingEntry()->GetUniqueID();
orig_rfh->PrepareForCommit();
- contents()->TestDidNavigate(orig_rfh, entry_id, true, url,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ orig_rfh, entry_id, true, url, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 0, 0);
// Keep the number of active frames in orig_rfh's SiteInstance non-zero so
// that orig_rfh doesn't get deleted when it gets swapped out.
@@ -556,8 +557,9 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
}
// DidNavigate from the pending page
- contents()->TestDidNavigate(pending_rfh, entry_id, true, url2,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ pending_rfh, entry_id, true, url2, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 1, 1);
SiteInstance* instance2 = contents()->GetSiteInstance();
// Keep the number of active frames in pending_rfh's SiteInstance
@@ -594,8 +596,9 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) {
}
// DidNavigate from the back action
- contents()->TestDidNavigate(goback_rfh, entry_id, false, url2,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ goback_rfh, entry_id, false, url2, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 2, 0);
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
EXPECT_EQ(goback_rfh, main_test_rfh());
EXPECT_EQ(instance1, contents()->GetSiteInstance());
@@ -1140,8 +1143,9 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) {
int entry_id = controller().GetPendingEntry()->GetUniqueID();
TestRenderFrameHost* webui_rfh = main_test_rfh();
webui_rfh->PrepareForCommit();
- contents()->TestDidNavigate(webui_rfh, entry_id, true, url1,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ webui_rfh, entry_id, true, url1, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 0, 0);
NavigationEntry* entry1 = controller().GetLastCommittedEntry();
SiteInstance* instance1 = contents()->GetSiteInstance();
@@ -1166,8 +1170,9 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) {
webui_rfh->PrepareForCommit();
// DidNavigate from the pending page.
- contents()->TestDidNavigate(google_rfh, entry_id, true, url2,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ google_rfh, entry_id, true, url2, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 1, 1);
NavigationEntry* entry2 = controller().GetLastCommittedEntry();
SiteInstance* instance2 = contents()->GetSiteInstance();
@@ -1188,8 +1193,9 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) {
entry_id = controller().GetPendingEntry()->GetUniqueID();
EXPECT_FALSE(contents()->CrossProcessNavigationPending());
main_test_rfh()->PrepareForCommit();
- contents()->TestDidNavigate(google_rfh, entry_id, true, url3,
- ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ google_rfh, entry_id, true, url3, Referrer(), ui::PAGE_TRANSITION_TYPED,
+ false, 2, 2);
NavigationEntry* entry3 = controller().GetLastCommittedEntry();
SiteInstance* instance3 = contents()->GetSiteInstance();
@@ -1221,8 +1227,9 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) {
FrameHostMsg_BeforeUnload_ACK(0, true, now, now));
// DidNavigate from the first back. This aborts the second back's pending RFH.
- contents()->TestDidNavigate(google_rfh, goback_entry->GetUniqueID(), false,
- url2, ui::PAGE_TRANSITION_TYPED);
+ contents()->TestDidNavigateWithSequenceNumber(
+ google_rfh, goback_entry->GetUniqueID(), false, url2, Referrer(),
+ ui::PAGE_TRANSITION_TYPED, false, 1, 1);
// We should commit this page and forget about the second back.
EXPECT_FALSE(contents()->CrossProcessNavigationPending());

Powered by Google App Engine
This is Rietveld 408576698