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, |