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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Rebase. Created 3 years, 10 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/renderer/render_view_browsertest.cc ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame_host.cc
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index ff25114a8d9eedd504dcedbedb014f2c7078b416..6558a129032199dc9ab0101ae138eb3b566d3fea 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -429,6 +429,7 @@ void TestRenderFrameHost::SendRendererInitiatedNavigationRequest(
common_params.url = url;
common_params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault);
common_params.transition = ui::PAGE_TRANSITION_LINK;
+ common_params.navigation_type = FrameMsg_Navigate_Type::DIFFERENT_DOCUMENT;
OnBeginNavigation(common_params, begin_params);
}
}
@@ -458,8 +459,10 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
// PlzNavigate
NavigationRequest* request = frame_tree_node_->navigation_request();
CHECK(request);
- bool have_to_make_network_request = ShouldMakeNetworkRequestForURL(
- request->common_params().url);
+ bool have_to_make_network_request =
+ ShouldMakeNetworkRequestForURL(request->common_params().url) &&
+ !FrameMsg_Navigate_Type::IsSameDocument(
+ request->common_params().navigation_type);
// Simulate a beforeUnload ACK from the renderer if the browser is waiting for
// it. If it runs it will update the request state.
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698