Index: content/browser/frame_host/render_frame_host_manager_unittest.cc |
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc |
index 47530a8d5c5d760a0c623f824ef039624d220c41..e1d2b5b8891c1a138a015fc46542c5bf6053aab3 100644 |
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc |
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc |
@@ -81,21 +81,13 @@ |
// WebUIFactory implementation. |
WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, |
const GURL& url) const override { |
- // If WebUI creation is enabled for the test and this is a WebUI URL, |
- // returns a new instance. |
- if (should_create_webui_ && HasWebUIScheme(url)) |
- return new WebUIController(web_ui); |
- return nullptr; |
+ if (!(should_create_webui_ && HasWebUIScheme(url))) |
+ return NULL; |
+ return new WebUIController(web_ui); |
} |
WebUI::TypeID GetWebUIType(BrowserContext* browser_context, |
const GURL& url) const override { |
- // If WebUI creation is enabled for the test and this is a WebUI URL, |
- // returns a mock WebUI type. |
- if (should_create_webui_ && HasWebUIScheme(url)) { |
- return const_cast<RenderFrameHostManagerTestWebUIControllerFactory*>( |
- this); |
- } |
return WebUI::kNoWebUI; |
} |
@@ -1124,7 +1116,12 @@ |
// The Web UI is committed immediately because the RenderViewHost has not been |
// used yet. UpdateStateForNavigate() took the short cut path. |
- EXPECT_FALSE(manager->GetNavigatingWebUI()); |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserSideNavigation)) { |
+ EXPECT_FALSE(manager->speculative_web_ui()); |
+ } else { |
+ EXPECT_FALSE(manager->pending_web_ui()); |
+ } |
EXPECT_TRUE(manager->web_ui()); |
// Commit. |
@@ -1194,7 +1191,12 @@ |
// No cross-process transition happens because we are already in the right |
// SiteInstance. We should grant bindings immediately. |
EXPECT_EQ(host2, manager2->current_frame_host()); |
- EXPECT_TRUE(manager2->GetNavigatingWebUI()); |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableBrowserSideNavigation)) { |
+ EXPECT_TRUE(manager2->speculative_web_ui()); |
+ } else { |
+ EXPECT_TRUE(manager2->pending_web_ui()); |
+ } |
EXPECT_TRUE( |
host2->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); |