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

Unified Diff: content/browser/renderer_host/media/video_capture_manager_unittest.cc

Issue 2805533002: Reland [Mojo Video Capture] Introduce abstraction VideoCaptureSystem (Closed)
Patch Set: Fix race condition in tests Created 3 years, 8 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
Index: content/browser/renderer_host/media/video_capture_manager_unittest.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager_unittest.cc b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
index 778b906072a03443890e3cb2a53e69ba3fb0f3e7..e4c9ff78e7e2849f8690548f53be732bd9eed458 100644
--- a/content/browser/renderer_host/media/video_capture_manager_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
@@ -24,6 +24,7 @@
#include "content/common/media/media_stream_options.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "media/capture/video/fake_video_capture_device_factory.h"
+#include "media/capture/video/video_capture_system.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -196,12 +197,13 @@ class VideoCaptureManagerTest : public testing::Test {
protected:
void SetUp() override {
listener_.reset(new MockMediaStreamProviderListener());
- vcm_ = new VideoCaptureManager(
- std::unique_ptr<media::VideoCaptureDeviceFactory>(
- new WrappedDeviceFactory()),
- base::ThreadTaskRunnerHandle::Get());
- video_capture_device_factory_ = static_cast<WrappedDeviceFactory*>(
- vcm_->video_capture_device_factory());
+ auto video_capture_device_factory =
+ base::MakeUnique<WrappedDeviceFactory>();
+ video_capture_device_factory_ = video_capture_device_factory.get();
+ auto video_capture_system = base::MakeUnique<media::VideoCaptureSystem>(
+ std::move(video_capture_device_factory));
+ vcm_ = new VideoCaptureManager(std::move(video_capture_system),
+ base::ThreadTaskRunnerHandle::Get());
const int32_t kNumberOfFakeDevices = 2;
video_capture_device_factory_->SetToDefaultDevicesConfig(
kNumberOfFakeDevices);

Powered by Google App Engine
This is Rietveld 408576698