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

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

Issue 91343002: Added supported formats caching to VideoCaptureManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mad formatting corrected in certain files. Created 7 years 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/video/capture/video_capture_device_unittest.cc
diff --git a/media/video/capture/video_capture_device_unittest.cc b/media/video/capture/video_capture_device_unittest.cc
index 705167def5510dea41454b5fd6b46236a993d81a..24dc45b9bfebd2115cf4f07e54058b933ce360fe 100644
--- a/media/video/capture/video_capture_device_unittest.cc
+++ b/media/video/capture/video_capture_device_unittest.cc
@@ -369,12 +369,12 @@ TEST_F(VideoCaptureDeviceTest, GetDeviceSupportedFormats) {
DVLOG(1) << "No camera available. Exiting test.";
return;
}
- VideoCaptureCapabilities capture_capabilities;
+ VideoCaptureFormats supported_formats;
VideoCaptureDevice::Names::iterator names_iterator;
for (names_iterator = names_.begin(); names_iterator != names_.end();
++names_iterator) {
VideoCaptureDevice::GetDeviceSupportedFormats(*names_iterator,
- &capture_capabilities);
+ &supported_formats);
// Nothing to test here since we cannot forecast the hardware capabilities.
}
}
@@ -413,20 +413,22 @@ TEST_F(VideoCaptureDeviceTest, FakeGetDeviceSupportedFormats) {
VideoCaptureDevice::Names names;
FakeVideoCaptureDevice::GetDeviceNames(&names);
- VideoCaptureCapabilities capture_capabilities;
+ VideoCaptureFormats supported_formats;
VideoCaptureDevice::Names::iterator names_iterator;
for (names_iterator = names.begin(); names_iterator != names.end();
++names_iterator) {
FakeVideoCaptureDevice::GetDeviceSupportedFormats(*names_iterator,
- &capture_capabilities);
- EXPECT_GE(capture_capabilities.size(), 1u);
- EXPECT_EQ(capture_capabilities[0].supported_format.frame_size.width(), 640);
- EXPECT_EQ(capture_capabilities[0].supported_format.frame_size.height(),
- 480);
- EXPECT_EQ(capture_capabilities[0].supported_format.pixel_format,
- media::PIXEL_FORMAT_I420);
- EXPECT_GE(capture_capabilities[0].supported_format.frame_rate, 20);
+ &supported_formats);
+ EXPECT_EQ(supported_formats.size(), 2u);
+ EXPECT_EQ(supported_formats[0].frame_size.width(), 640);
+ EXPECT_EQ(supported_formats[0].frame_size.height(), 480);
+ EXPECT_EQ(supported_formats[0].pixel_format, media::PIXEL_FORMAT_I420);
+ EXPECT_GE(supported_formats[0].frame_rate, 20);
+ EXPECT_EQ(supported_formats[1].frame_size.width(), 320);
+ EXPECT_EQ(supported_formats[1].frame_size.height(), 240);
+ EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420);
+ EXPECT_GE(supported_formats[1].frame_rate, 20);
}
}

Powered by Google App Engine
This is Rietveld 408576698