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

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: Address CR comments.. Created 5 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/test/test_web_contents.cc
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 6a2e05e2b9cc805bcd8109b20f72f186841f8c35..82fe0c6c9bd687b1b8a3ded189f83868386866a3 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 = GetNextMainFrameCandidate();
+
if (!rfh)
rfh = old_rfh;
@@ -227,6 +228,15 @@ void TestWebContents::TestDidFailLoadWithError(
frame_tree_.root()->current_frame_host()->OnMessageReceived(msg);
}
+TestRenderFrameHost* TestWebContents::GetNextMainFrameCandidate() 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