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

Unified Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2692883004: Allow FakeVideoCaptureDeviceFactory to specify number of supported formats per device. (Closed)
Patch Set: update comment 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: media/capture/video/fake_video_capture_device_unittest.cc
diff --git a/media/capture/video/fake_video_capture_device_unittest.cc b/media/capture/video/fake_video_capture_device_unittest.cc
index c128ad96d49fa74e7ca9cd68df5f9a20a6b8866b..cdf8c07bb51349df165fb9c31b531b7c7ac34ead 100644
--- a/media/capture/video/fake_video_capture_device_unittest.cc
+++ b/media/capture/video/fake_video_capture_device_unittest.cc
@@ -495,6 +495,20 @@ TEST_F(FakeVideoCaptureDeviceTest, TakePhoto) {
device->StopAndDeAllocate();
}
+TEST_F(FakeVideoCaptureDeviceTest, ZeroFormats) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kUseFakeDeviceForMediaStream, "device-count=2,format-count=0");
+ std::unique_ptr<VideoCaptureDeviceDescriptors> descriptors(
+ EnumerateDevices());
+ ASSERT_EQ(2u, descriptors->size());
+ for (const auto& descriptor : *descriptors) {
+ VideoCaptureFormats supported_formats;
+ video_capture_device_factory_->GetSupportedFormats(descriptor,
+ &supported_formats);
+ EXPECT_EQ(0u, supported_formats.size());
+ }
+}
+
TEST_P(FakeVideoCaptureDeviceCommandLineTest, FrameRateAndDeviceCount) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kUseFakeDeviceForMediaStream, GetParam().argument);

Powered by Google App Engine
This is Rietveld 408576698