summaryrefslogtreecommitdiffstats
path: root/content/test/test_web_contents.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/test/test_web_contents.cc')
-rw-r--r--content/test/test_web_contents.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc
index 788081a..c1ca5ea 100644
--- a/content/test/test_web_contents.cc
+++ b/content/test/test_web_contents.cc
@@ -6,7 +6,6 @@
#include <utility>
-#include "base/command_line.h"
#include "content/browser/browser_url_handler_impl.h"
#include "content/browser/frame_host/cross_process_frame_connector.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
@@ -19,7 +18,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
-#include "content/public/common/content_switches.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/page_state.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/test/test_render_view_host.h"
@@ -55,8 +54,7 @@ TestRenderViewHost* TestWebContents::GetRenderViewHost() const {
}
TestRenderFrameHost* TestWebContents::GetPendingMainFrame() const {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation)) {
+ if (IsBrowserSideNavigationEnabled()) {
return static_cast<TestRenderFrameHost*>(
GetRenderManager()->speculative_render_frame_host_.get());
}
@@ -74,8 +72,7 @@ void TestWebContents::StartNavigation(const GURL& url) {
// This will simulate receiving the DidStartProvisionalLoad IPC from the
// renderer.
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation)) {
+ if (!IsBrowserSideNavigationEnabled()) {
if (GetMainFrame()->is_waiting_for_beforeunload_ack())
GetMainFrame()->SendBeforeUnloadACK(true);
TestRenderFrameHost* rfh =
@@ -150,8 +147,7 @@ const std::string& TestWebContents::GetSaveFrameHeaders() {
}
bool TestWebContents::CrossProcessNavigationPending() {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation)) {
+ if (IsBrowserSideNavigationEnabled()) {
return GetRenderManager()->speculative_render_frame_host_ &&
static_cast<TestRenderFrameHost*>(
GetRenderManager()->speculative_render_frame_host_.get())
@@ -215,9 +211,7 @@ void TestWebContents::CommitPendingNavigation() {
// Note that for some synchronous navigations (about:blank, javascript
// urls, etc.) there will be no NavigationRequest, and no simulation of the
// network stack is required.
- bool browser_side_navigation =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableBrowserSideNavigation);
+ bool browser_side_navigation = IsBrowserSideNavigationEnabled();
if (!browser_side_navigation ||
GetMainFrame()->frame_tree_node()->navigation_request()) {
GetMainFrame()->PrepareForCommit();