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

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

Issue 2715513008: Make FakeVideoCaptureDeviceFactory configurable to arbitrary fake device configurations (Closed)
Patch Set: Fix compiler warning. Fix WebRtcDepthCaptureBrowserTest. Created 3 years, 10 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 bf47379bed7c40280fd8d5ad17be8bb6d713227f..8a0f5fbd1ef365acfbb1b9f787f0b0674ed63b81 100644
--- a/content/browser/renderer_host/media/video_capture_manager_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_manager_unittest.cc
@@ -201,7 +201,8 @@ class VideoCaptureManagerTest : public testing::Test {
video_capture_device_factory_ = static_cast<WrappedDeviceFactory*>(
vcm_->video_capture_device_factory());
const int32_t kNumberOfFakeDevices = 2;
- video_capture_device_factory_->set_number_of_devices(kNumberOfFakeDevices);
+ video_capture_device_factory_->SetToDefaultDevicesConfig(
+ kNumberOfFakeDevices);
vcm_->RegisterListener(listener_.get());
frame_observer_.reset(new MockFrameObserver());
@@ -400,7 +401,7 @@ TEST_F(VideoCaptureManagerTest, ConnectAndDisconnectDevices) {
video_capture_device_factory_->number_of_devices();
// Simulate we remove 1 fake device.
- video_capture_device_factory_->set_number_of_devices(1);
+ video_capture_device_factory_->SetToDefaultDevicesConfig(1);
base::RunLoop run_loop;
vcm_->EnumerateDevices(
base::Bind(&VideoCaptureManagerTest::HandleEnumerationResult,
@@ -409,7 +410,7 @@ TEST_F(VideoCaptureManagerTest, ConnectAndDisconnectDevices) {
ASSERT_EQ(devices_.size(), 1u);
// Simulate we add 2 fake devices.
- video_capture_device_factory_->set_number_of_devices(3);
+ video_capture_device_factory_->SetToDefaultDevicesConfig(3);
base::RunLoop run_loop2;
vcm_->EnumerateDevices(
base::Bind(&VideoCaptureManagerTest::HandleEnumerationResult,
@@ -418,7 +419,8 @@ TEST_F(VideoCaptureManagerTest, ConnectAndDisconnectDevices) {
ASSERT_EQ(devices_.size(), 3u);
vcm_->UnregisterListener();
- video_capture_device_factory_->set_number_of_devices(number_of_devices_keep);
+ video_capture_device_factory_->SetToDefaultDevicesConfig(
+ number_of_devices_keep);
}
// Enumerate devices and open the first, then check the list of supported

Powered by Google App Engine
This is Rietveld 408576698