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

Unified Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 1422043007: Revert of Move WebUI ownership from the RenderFrameHostManager to the RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: 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);
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager_browsertest.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698