OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "services/video_capture/test/device_factory_provider_test.h" |
| 6 |
| 7 #include "services/service_manager/public/interfaces/constants.mojom.h" |
| 8 #include "services/service_manager/public/interfaces/service_manager.mojom.h" |
| 9 #include "services/video_capture/public/interfaces/constants.mojom.h" |
| 10 |
| 11 namespace video_capture { |
| 12 |
| 13 ServiceManagerListenerImpl::ServiceManagerListenerImpl( |
| 14 service_manager::mojom::ServiceManagerListenerRequest request, |
| 15 base::RunLoop* loop) |
| 16 : binding_(this, std::move(request)), loop_(loop) {} |
| 17 |
| 18 ServiceManagerListenerImpl::~ServiceManagerListenerImpl() = default; |
| 19 |
| 20 DeviceFactoryProviderTest::DeviceFactoryProviderTest() |
| 21 : service_manager::test::ServiceTest("video_capture_unittests") {} |
| 22 |
| 23 DeviceFactoryProviderTest::~DeviceFactoryProviderTest() = default; |
| 24 |
| 25 void DeviceFactoryProviderTest::SetUp() { |
| 26 service_manager::test::ServiceTest::SetUp(); |
| 27 |
| 28 service_manager::mojom::ServiceManagerPtr service_manager; |
| 29 connector()->BindInterface(service_manager::mojom::kServiceName, |
| 30 &service_manager); |
| 31 service_manager::mojom::ServiceManagerListenerPtr listener; |
| 32 base::RunLoop loop; |
| 33 service_state_observer_ = base::MakeUnique<ServiceManagerListenerImpl>( |
| 34 mojo::MakeRequest(&listener), &loop); |
| 35 service_manager->AddListener(std::move(listener)); |
| 36 loop.Run(); |
| 37 |
| 38 connector()->BindInterface(mojom::kServiceName, &factory_provider_); |
| 39 factory_provider_->SetShutdownDelayInSeconds(0.0f); |
| 40 factory_provider_->ConnectToFakeDeviceFactory(mojo::MakeRequest(&factory_)); |
| 41 } |
| 42 |
| 43 } // namespace video_capture |
OLD | NEW |