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

Unified Diff: chrome/test/base/browser_with_test_window_test.cc

Issue 2296483002: Fix some unit_tests under PlzNavigate (Closed)
Patch Set: teardown Created 4 years, 4 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: 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..d6cf028a8e36d01f0a18fe41629146141a1aa4f5 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,6 +136,7 @@ void BrowserWithTestWindowTest::CommitPendingLoad(
return; // Nothing to commit.
RenderFrameHost* old_rfh = controller->GetWebContents()->GetMainFrame();
+ content::SimulateCurrentRenderFrameHostUnloading(old_rfh);
RenderFrameHost* pending_rfh = RenderFrameHostTester::GetPendingForController(
controller);

Powered by Google App Engine
This is Rietveld 408576698