| Index: chrome/test/base/browser_with_test_window_test.cc
|
| diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc
|
| index 967d987a9767d7bd18ab6778fd9090bf329c94f7..2e4808f204158aa2225275560b40f46fb289f005 100644
|
| --- a/chrome/test/base/browser_with_test_window_test.cc
|
| +++ b/chrome/test/base/browser_with_test_window_test.cc
|
| @@ -19,6 +19,8 @@
|
| #include "content/public/browser/navigation_controller.h"
|
| #include "content/public/browser/navigation_entry.h"
|
| #include "content/public/browser/web_contents.h"
|
| +#include "content/public/common/browser_side_navigation_policy.h"
|
| +#include "content/public/test/browser_side_navigation_test_utils.h"
|
| #include "content/public/test/test_renderer_host.h"
|
| #include "ui/base/page_transition_types.h"
|
|
|
| @@ -65,6 +67,9 @@ void BrowserWithTestWindowTest::SetUp() {
|
| SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient());
|
| #endif
|
|
|
| + if (content::IsBrowserSideNavigationEnabled())
|
| + content::BrowserSideNavigationSetUp();
|
| +
|
| // Subclasses can provide their own Profile.
|
| profile_ = CreateProfile();
|
| // Subclasses can provide their own test BrowserWindow. If they return NULL
|
| @@ -85,6 +90,9 @@ void BrowserWithTestWindowTest::TearDown() {
|
| // audio service) depend on test stubs that the helpers below will remove.
|
| DestroyBrowserAndProfile();
|
|
|
| + if (content::IsBrowserSideNavigationEnabled())
|
| + content::BrowserSideNavigationTearDown();
|
| +
|
| #if defined(TOOLKIT_VIEWS)
|
| constrained_window::SetConstrainedWindowViewsClient(nullptr);
|
| #endif
|
| @@ -128,23 +136,16 @@ void BrowserWithTestWindowTest::CommitPendingLoad(
|
| return; // Nothing to commit.
|
|
|
| RenderFrameHost* old_rfh = controller->GetWebContents()->GetMainFrame();
|
| + RenderFrameHostTester* old_rfh_tester = RenderFrameHostTester::For(old_rfh);
|
| + old_rfh_tester->PrepareForCommitIfNecessary();
|
|
|
| RenderFrameHost* pending_rfh = RenderFrameHostTester::GetPendingForController(
|
| controller);
|
| - if (pending_rfh) {
|
| - // Simulate the BeforeUnload_ACK that is received from the current renderer
|
| - // for a cross-site navigation.
|
| - DCHECK_NE(old_rfh, pending_rfh);
|
| - RenderFrameHostTester::For(old_rfh)->SendBeforeUnloadACK(true);
|
| - }
|
| +
|
| // Commit on the pending_rfh, if one exists.
|
| RenderFrameHost* test_rfh = pending_rfh ? pending_rfh : old_rfh;
|
| RenderFrameHostTester* test_rfh_tester = RenderFrameHostTester::For(test_rfh);
|
|
|
| - // Simulate a SwapOut_ACK before the navigation commits.
|
| - if (pending_rfh)
|
| - RenderFrameHostTester::For(old_rfh)->SimulateSwapOutACK();
|
| -
|
| // For new navigations, we need to send a larger page ID. For renavigations,
|
| // we need to send the preexisting page ID. We can tell these apart because
|
| // renavigations will have a pending_entry_index while new ones won't (they'll
|
|
|