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

Unified Diff: content/test/test_web_contents.cc

Issue 701953006: PlzNavigate: Speculatively spawns a renderer process for navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments, mostly -- but not all -- nits. Created 5 years, 12 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/test/test_web_contents.cc
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 6a2e05e2b9cc805bcd8109b20f72f186841f8c35..59d98c4966cdd8fb749ac11baccd547b0b23f4c8 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -154,7 +154,8 @@ void TestWebContents::CommitPendingNavigation() {
// proper renderer.
old_rfh->PrepareForCommit(entry->GetURL());
- TestRenderFrameHost* rfh = GetPendingMainFrame();
+ TestRenderFrameHost* rfh = GetFutureMainFrame();
+
if (!rfh)
rfh = old_rfh;
@@ -227,6 +228,15 @@ void TestWebContents::TestDidFailLoadWithError(
frame_tree_.root()->current_frame_host()->OnMessageReceived(msg);
}
+TestRenderFrameHost* TestWebContents::GetFutureMainFrame() const {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ return static_cast<TestRenderFrameHost*>(
+ GetRenderManager()->speculative_render_frame_host_.get());
+ }
+ return GetPendingMainFrame();
+}
+
void TestWebContents::CreateNewWindow(
int render_process_id,
int route_id,
« content/browser/frame_host/render_frame_host_manager.cc ('K') | « content/test/test_web_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698