| OLD | NEW |
| 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 "services/device/device_service_test_base.h" | 5 #include "services/device/device_service_test_base.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public: | 30 public: |
| 31 explicit ServiceTestClient(service_manager::test::ServiceTest* test) | 31 explicit ServiceTestClient(service_manager::test::ServiceTest* test) |
| 32 : service_manager::test::ServiceTestClient(test), | 32 : service_manager::test::ServiceTestClient(test), |
| 33 io_thread_("DeviceServiceTestIOThread"), | 33 io_thread_("DeviceServiceTestIOThread"), |
| 34 file_thread_("DeviceServiceTestFileThread") { | 34 file_thread_("DeviceServiceTestFileThread") { |
| 35 registry_.AddInterface<service_manager::mojom::ServiceFactory>(this); | 35 registry_.AddInterface<service_manager::mojom::ServiceFactory>(this); |
| 36 } | 36 } |
| 37 ~ServiceTestClient() override {} | 37 ~ServiceTestClient() override {} |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 void OnBindInterface(const service_manager::ServiceInfo& source_info, | 40 void OnBindInterface(const service_manager::BindSourceInfo& source_info, |
| 41 const std::string& interface_name, | 41 const std::string& interface_name, |
| 42 mojo::ScopedMessagePipeHandle interface_pipe) override { | 42 mojo::ScopedMessagePipeHandle interface_pipe) override { |
| 43 registry_.BindInterface(source_info.identity, interface_name, | 43 registry_.BindInterface(source_info.identity, interface_name, |
| 44 std::move(interface_pipe)); | 44 std::move(interface_pipe)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void CreateService(service_manager::mojom::ServiceRequest request, | 47 void CreateService(service_manager::mojom::ServiceRequest request, |
| 48 const std::string& name) override { | 48 const std::string& name) override { |
| 49 if (name == device::mojom::kServiceName) { | 49 if (name == device::mojom::kServiceName) { |
| 50 io_thread_.Start(); | 50 io_thread_.Start(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 : ServiceTest(kTestServiceName) {} | 86 : ServiceTest(kTestServiceName) {} |
| 87 | 87 |
| 88 DeviceServiceTestBase::~DeviceServiceTestBase() {} | 88 DeviceServiceTestBase::~DeviceServiceTestBase() {} |
| 89 | 89 |
| 90 std::unique_ptr<service_manager::Service> | 90 std::unique_ptr<service_manager::Service> |
| 91 DeviceServiceTestBase::CreateService() { | 91 DeviceServiceTestBase::CreateService() { |
| 92 return base::MakeUnique<ServiceTestClient>(this); | 92 return base::MakeUnique<ServiceTestClient>(this); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace device | 95 } // namespace device |
| OLD | NEW |