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

Side by Side Diff: content/common/service_manager/service_manager_connection_impl_unittest.cc

Issue 2850743004: Replace ServiceInfo with BindSourceInfo. (Closed)
Patch Set: . Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/service_manager/service_manager_connection_impl.h" 5 #include "content/common/service_manager/service_manager_connection_impl.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "services/service_manager/public/cpp/identity.h" 10 #include "services/service_manager/public/cpp/identity.h"
(...skipping 23 matching lines...) Expand all
34 ServiceManagerConnectionImpl connection_impl(mojo::MakeRequest(&service), 34 ServiceManagerConnectionImpl connection_impl(mojo::MakeRequest(&service),
35 io_thread.task_runner()); 35 io_thread.task_runner());
36 ServiceManagerConnection& connection = connection_impl; 36 ServiceManagerConnection& connection = connection_impl;
37 ServiceInfo info; 37 ServiceInfo info;
38 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, 38 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL,
39 base::WaitableEvent::InitialState::NOT_SIGNALED); 39 base::WaitableEvent::InitialState::NOT_SIGNALED);
40 info.factory = base::Bind(&LaunchService, &event); 40 info.factory = base::Bind(&LaunchService, &event);
41 info.task_runner = io_thread.task_runner(); 41 info.task_runner = io_thread.task_runner();
42 connection.AddEmbeddedService(kTestServiceName, info); 42 connection.AddEmbeddedService(kTestServiceName, info);
43 connection.Start(); 43 connection.Start();
44 service_manager::ServiceInfo source_info( 44 service_manager::BindSourceInfo source_info(
45 {service_manager::mojom::kServiceName, 45 {service_manager::mojom::kServiceName,
46 service_manager::mojom::kRootUserID}, 46 service_manager::mojom::kRootUserID},
47 service_manager::InterfaceProviderSpecMap{}); 47 service_manager::CapabilitySet());
48 service_manager::mojom::ServiceFactoryPtr factory; 48 service_manager::mojom::ServiceFactoryPtr factory;
49 service->OnBindInterface(source_info, 49 service->OnBindInterface(source_info,
50 service_manager::mojom::ServiceFactory::Name_, 50 service_manager::mojom::ServiceFactory::Name_,
51 mojo::MakeRequest(&factory).PassMessagePipe(), 51 mojo::MakeRequest(&factory).PassMessagePipe(),
52 base::Bind(&base::DoNothing)); 52 base::Bind(&base::DoNothing));
53 service_manager::mojom::ServicePtr created_service; 53 service_manager::mojom::ServicePtr created_service;
54 factory->CreateService(mojo::MakeRequest(&created_service), kTestServiceName); 54 factory->CreateService(mojo::MakeRequest(&created_service), kTestServiceName);
55 event.Wait(); 55 event.Wait();
56 } 56 }
57 57
58 } // namespace content 58 } // namespace content
OLDNEW
« no previous file with comments | « content/common/service_manager/service_manager_connection_impl.cc ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698