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

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

Issue 24079003: Add VideoCaptureDevice::GetDeviceSupportedFormats to interface + implementation for Linux and Fake (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed parameter device_name from GetDeviceSupportedFormats. Added explanation to VCD interface. Created 7 years, 3 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/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 5a19d272c93d3eef65707bf92b21173bcfc0b0e2..5a7402dbd6fb3e2357dc1b6cdf9aa3f9b68bedb3 100644
--- a/media/video/capture/video_capture_device_unittest.cc
+++ b/media/video/capture/video_capture_device_unittest.cc
@@ -120,6 +120,7 @@ class VideoCaptureDeviceTest : public testing::Test {
base::WaitableEvent wait_event_;
scoped_ptr<MockFrameObserver> frame_observer_;
VideoCaptureDevice::Names names_;
+ VideoCaptureFormats capture_formats_;
scoped_ptr<base::MessageLoop> loop_;
};
@@ -450,4 +451,20 @@ TEST_F(VideoCaptureDeviceTest, FakeCaptureVariableResolution) {
device->DeAllocate();
}
+TEST_F(VideoCaptureDeviceTest, GetDeviceSupportedFormats) {
+ VideoCaptureDevice::Names names;
+
+ FakeVideoCaptureDevice::GetDeviceNames(&names);
+ scoped_ptr<VideoCaptureDevice> device(
+ FakeVideoCaptureDevice::Create(names.front()));
+ ASSERT_TRUE(device.get() != NULL);
+ device->GetDeviceSupportedFormats(&capture_formats_);
+
+ EXPECT_GE(capture_formats_.size(), 1u);
+ EXPECT_EQ(capture_formats_[0].width, 640);
+ EXPECT_EQ(capture_formats_[0].height, 480);
+ EXPECT_EQ(capture_formats_[0].color, media::PIXEL_FORMAT_I420);
+ EXPECT_GE(capture_formats_[0].frame_rate, 20);
+}
+
}; // namespace media

Powered by Google App Engine
This is Rietveld 408576698