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

Unified Diff: services/service_manager/public/cpp/lib/service_test.cc

Issue 2651953002: Revert of [Service Manager] Get rid of dynamic service discovery (Closed)
Patch Set: Created 3 years, 11 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/service_manager/public/cpp/BUILD.gn ('k') | services/service_manager/public/cpp/service.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/public/cpp/lib/service_test.cc
diff --git a/services/service_manager/public/cpp/lib/service_test.cc b/services/service_manager/public/cpp/lib/service_test.cc
index 23ee61ea455448055391b7aeb99fbdeeba9cee07..054c8a8992b8321b1a3074910fbb450aa25c8002 100644
--- a/services/service_manager/public/cpp/lib/service_test.cc
+++ b/services/service_manager/public/cpp/lib/service_test.cc
@@ -7,9 +7,6 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
-#include "base/threading/thread.h"
-#include "mojo/edk/embedder/embedder.h"
-#include "mojo/edk/embedder/scoped_ipc_support.h"
#include "services/service_manager/background/background_service_manager.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_context.h"
@@ -63,12 +60,11 @@
void ServiceTest::SetUp() {
message_loop_ = CreateMessageLoop();
-
- DCHECK(!init_edk_);
-
- background_service_manager_ =
- base::MakeUnique<service_manager::BackgroundServiceManager>(
- nullptr, nullptr);
+ background_service_manager_.reset(
+ new service_manager::BackgroundServiceManager);
+ auto init_params = base::MakeUnique<BackgroundServiceManager::InitParams>();
+ init_params->init_edk = init_edk_;
+ background_service_manager_->Init(std::move(init_params));
// Create the service manager connection. We don't proceed until we get our
// Service's OnStart() method is called.
@@ -77,12 +73,11 @@
base::MessageLoop::current());
initialize_called_ = run_loop.QuitClosure();
- mojom::ServicePtr service;
- context_ = base::MakeUnique<ServiceContext>(CreateService(),
- mojom::ServiceRequest(&service));
- background_service_manager_->RegisterService(
- Identity(test_name_, mojom::kRootUserID), std::move(service), nullptr);
+ context_.reset(new ServiceContext(
+ CreateService(),
+ background_service_manager_->CreateServiceRequest(test_name_)));
connector_ = context_->connector();
+
run_loop.Run();
}
« no previous file with comments | « services/service_manager/public/cpp/BUILD.gn ('k') | services/service_manager/public/cpp/service.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698