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

Unified Diff: services/preferences/pref_service_factory_unittest.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 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 | « services/navigation/navigation.cc ('k') | services/preferences/pref_store_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/preferences/pref_service_factory_unittest.cc
diff --git a/services/preferences/pref_service_factory_unittest.cc b/services/preferences/pref_service_factory_unittest.cc
index a2a34dd2c1edbee33138bbf1e4fee8fffd7e2d35..21094e823adff98799081d2455d458a8237ad647 100644
--- a/services/preferences/pref_service_factory_unittest.cc
+++ b/services/preferences/pref_service_factory_unittest.cc
@@ -17,8 +17,8 @@
#include "services/preferences/public/cpp/pref_service_main.h"
#include "services/preferences/public/cpp/pref_store_impl.h"
#include "services/preferences/public/interfaces/preferences.mojom.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/interface_factory.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
#include "services/service_manager/public/cpp/service_context.h"
#include "services/service_manager/public/cpp/service_test.h"
#include "services/service_manager/public/interfaces/service_factory.mojom.h"
@@ -34,13 +34,16 @@ class ServiceTestClient : public service_manager::test::ServiceTestClient,
ServiceTestClient(service_manager::test::ServiceTest* test,
scoped_refptr<base::SequencedWorkerPool> worker_pool)
: service_manager::test::ServiceTestClient(test),
- worker_pool_(std::move(worker_pool)) {}
+ worker_pool_(std::move(worker_pool)) {
+ registry_.AddInterface<service_manager::mojom::ServiceFactory>(this);
+ }
protected:
- bool OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) override {
- registry->AddInterface<service_manager::mojom::ServiceFactory>(this);
- return true;
+ void OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) override {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
void CreateService(service_manager::mojom::ServiceRequest request,
@@ -63,6 +66,7 @@ class ServiceTestClient : public service_manager::test::ServiceTestClient,
private:
scoped_refptr<base::SequencedWorkerPool> worker_pool_;
+ service_manager::BinderRegistry registry_;
mojo::BindingSet<service_manager::mojom::ServiceFactory>
service_factory_bindings_;
std::unique_ptr<service_manager::ServiceContext> pref_service_context_;
« no previous file with comments | « services/navigation/navigation.cc ('k') | services/preferences/pref_store_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698