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

Unified Diff: content/shell/utility/shell_content_utility_client.cc

Issue 1965683002: Add a browser test for UtilityProcessHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 4 years, 7 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 | « content/shell/utility/shell_content_utility_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/utility/shell_content_utility_client.cc
diff --git a/content/shell/utility/shell_content_utility_client.cc b/content/shell/utility/shell_content_utility_client.cc
index a00bf62d54013db71208964b9a0211492947c1af..2af0813d60335c927bfe07e27c779ab400e63843 100644
--- a/content/shell/utility/shell_content_utility_client.cc
+++ b/content/shell/utility/shell_content_utility_client.cc
@@ -5,14 +5,42 @@
#include "content/shell/utility/shell_content_utility_client.h"
#include <memory>
+#include <utility>
#include "base/bind.h"
+#include "content/public/common/service_registry.h"
#include "content/public/test/test_mojo_app.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
namespace {
+class TestMojoServiceImpl : public mojom::TestMojoService {
+ public:
+ static void Create(mojo::InterfaceRequest<mojom::TestMojoService> request) {
+ new TestMojoServiceImpl(std::move(request));
+ }
+
+ // mojom::TestMojoService implementation:
+ void DoSomething(const DoSomethingCallback& callback) override {
+ callback.Run();
+ }
+
+ void GetRequestorName(const GetRequestorNameCallback& callback) override {
+ NOTREACHED();
+ }
+
+ private:
+ explicit TestMojoServiceImpl(
+ mojo::InterfaceRequest<mojom::TestMojoService> request)
+ : binding_(this, std::move(request)) {}
+
+ mojo::StrongBinding<mojom::TestMojoService> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestMojoServiceImpl);
+};
+
std::unique_ptr<shell::ShellClient> CreateTestApp(
const base::Closure& quit_closure) {
return std::unique_ptr<shell::ShellClient>(new TestMojoApp);
@@ -28,4 +56,9 @@ void ShellContentUtilityClient::RegisterMojoApplications(
apps->insert(std::make_pair(kTestMojoAppUrl, base::Bind(&CreateTestApp)));
}
+void ShellContentUtilityClient::RegisterMojoServices(
+ ServiceRegistry* registry) {
+ registry->AddService(base::Bind(&TestMojoServiceImpl::Create));
+}
+
} // namespace content
« no previous file with comments | « content/shell/utility/shell_content_utility_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698