Index: services/video_capture/test/device_factory_provider_test.cc |
diff --git a/services/video_capture/test/device_factory_provider_test.cc b/services/video_capture/test/device_factory_provider_test.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4c270281f795f339bbfb013278fd6e43c721928c |
--- /dev/null |
+++ b/services/video_capture/test/device_factory_provider_test.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "services/video_capture/test/device_factory_provider_test.h" |
+ |
+#include "services/service_manager/public/interfaces/constants.mojom.h" |
+#include "services/service_manager/public/interfaces/service_manager.mojom.h" |
+#include "services/video_capture/public/interfaces/constants.mojom.h" |
+ |
+namespace video_capture { |
+ |
+ServiceManagerListenerImpl::ServiceManagerListenerImpl( |
+ service_manager::mojom::ServiceManagerListenerRequest request, |
+ base::RunLoop* loop) |
+ : binding_(this, std::move(request)), loop_(loop) {} |
+ |
+ServiceManagerListenerImpl::~ServiceManagerListenerImpl() = default; |
+ |
+DeviceFactoryProviderTest::DeviceFactoryProviderTest() |
+ : service_manager::test::ServiceTest("video_capture_unittests") {} |
+ |
+DeviceFactoryProviderTest::~DeviceFactoryProviderTest() = default; |
+ |
+void DeviceFactoryProviderTest::SetUp() { |
+ service_manager::test::ServiceTest::SetUp(); |
+ |
+ service_manager::mojom::ServiceManagerPtr service_manager; |
+ connector()->BindInterface(service_manager::mojom::kServiceName, |
+ &service_manager); |
+ service_manager::mojom::ServiceManagerListenerPtr listener; |
+ base::RunLoop loop; |
+ service_state_observer_ = base::MakeUnique<ServiceManagerListenerImpl>( |
+ mojo::MakeRequest(&listener), &loop); |
+ service_manager->AddListener(std::move(listener)); |
+ loop.Run(); |
+ |
+ connector()->BindInterface(mojom::kServiceName, &factory_provider_); |
+ factory_provider_->SetShutdownDelayInSeconds(0.0f); |
+ factory_provider_->ConnectToFakeDeviceFactory(mojo::MakeRequest(&factory_)); |
+} |
+ |
+} // namespace video_capture |