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

Unified Diff: trunk/src/content/browser/webui/web_ui_mojo_browsertest.cc

Issue 352013002: Revert 279557 "Support exposing Mojo services between render fra..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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
« no previous file with comments | « trunk/src/content/browser/renderer_host/render_view_host_impl.cc ('k') | trunk/src/content/child/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/browser/webui/web_ui_mojo_browsertest.cc
===================================================================
--- trunk/src/content/browser/webui/web_ui_mojo_browsertest.cc (revision 279559)
+++ trunk/src/content/browser/webui/web_ui_mojo_browsertest.cc (working copy)
@@ -12,19 +12,15 @@
#include "base/strings/string_util.h"
#include "content/browser/webui/web_ui_controller_factory_registry.h"
#include "content/public/browser/browser_context.h"
-#include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
-#include "content/public/common/service_registry.h"
#include "content/public/common/url_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
-#include "content/shell/browser/shell.h"
#include "content/test/data/web_ui_test_mojo_bindings.mojom.h"
#include "grit/content_resources.h"
#include "mojo/common/test/test_utils.h"
@@ -129,20 +125,15 @@
PingTestWebUIController(WebUI* web_ui, base::RunLoop* run_loop)
: TestWebUIController(web_ui, run_loop) {
}
- virtual ~PingTestWebUIController() {}
// WebUIController overrides:
virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE {
- render_view_host->GetMainFrame()->GetServiceRegistry()->AddService(
- "webui_controller",
- base::Bind(&PingTestWebUIController::CreateHandler,
- base::Unretained(this)));
+ mojo::MessagePipe pipe;
+ browser_target_.reset(
+ new PingBrowserTargetImpl(pipe.handle0.Pass(), run_loop_));
+ render_view_host->SetWebUIHandle(pipe.handle1.Pass());
}
- void CreateHandler(mojo::ScopedMessagePipeHandle handle) {
- browser_target_.reset(new PingBrowserTargetImpl(handle.Pass(), run_loop_));
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(PingTestWebUIController);
};
@@ -221,19 +212,6 @@
// RunLoop is quit when message received from page.
run_loop.Run();
EXPECT_TRUE(got_message);
-
- // Check that a second render frame in the same renderer process works
- // correctly.
- Shell* other_shell = CreateBrowser();
- got_message = false;
- base::RunLoop other_run_loop;
- factory()->set_run_loop(&other_run_loop);
- NavigateToURL(other_shell, test_url);
- // RunLoop is quit when message received from page.
- other_run_loop.Run();
- EXPECT_TRUE(got_message);
- EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(),
- other_shell->web_contents()->GetRenderProcessHost());
}
} // namespace
« no previous file with comments | « trunk/src/content/browser/renderer_host/render_view_host_impl.cc ('k') | trunk/src/content/child/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698