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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2373273002: Run unload handlers when navigating to about:blank using PlzNavigate. (Closed)
Patch Set: undo incorrect change that broke chrome://crash Created 4 years, 2 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/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | 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 82fcac4f3d66c6b8f80f77e73c641fe0bd9c49e8..d94dce0881c284c5731ce934998ba49f7ab6a1ad 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -425,6 +425,8 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
// PlzNavigate
NavigationRequest* request = frame_tree_node_->navigation_request();
CHECK(request);
+ bool have_to_make_network_request = ShouldMakeNetworkRequestForURL(
+ request->common_params().url);
// Simulate a beforeUnload ACK from the renderer if the browser is waiting for
// it. If it runs it will update the request state.
@@ -433,6 +435,9 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
->SendBeforeUnloadACK(true);
}
+ if (!have_to_make_network_request)
+ return; // |request| is destructed by now.
+
CHECK(request->state() == NavigationRequest::STARTED);
TestNavigationURLLoader* url_loader =
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698