Chromium Code Reviews| 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..572f2bbdfea493729fa3fd85654df78325e97163 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; |
| @@ -172,8 +173,11 @@ void TestWebContents::CommitPendingNavigation() { |
| } |
| void TestWebContents::ProceedWithCrossSiteNavigation() { |
| - if (!GetPendingMainFrame()) |
| + if (!GetPendingMainFrame() || |
|
clamy
2014/12/29 17:36:22
This return is no longer necessary, as following t
carlosk
2014/12/30 15:54:50
Done.
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableBrowserSideNavigation)) { |
| return; |
| + } |
| GetMainFrame()->SendBeforeUnloadACK(true); |
| } |
| @@ -257,4 +261,17 @@ void TestWebContents::ShowCreatedWidget(int route_id, |
| void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
| } |
| +TestRenderFrameHost* TestWebContents::GetSpeculativeMainFrame() const { |
| + return static_cast<TestRenderFrameHost*>( |
| + GetRenderManager()->speculative_render_frame_host_.get()); |
| +} |
| + |
| +TestRenderFrameHost* TestWebContents::GetFutureMainFrame() const { |
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableBrowserSideNavigation)) { |
| + return GetSpeculativeMainFrame(); |
| + } |
| + return GetPendingMainFrame(); |
| +} |
| + |
| } // namespace content |