Chromium Code Reviews| 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 b2711ee1c74211b891e1c6d97c9dc23aa957ea44..b9060ed9d09b11baff54ded531118149139f9264 100644 |
| --- a/media/video/capture/video_capture_device_unittest.cc |
| +++ b/media/video/capture/video_capture_device_unittest.cc |
| @@ -269,6 +269,7 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) { |
| WaitForCapturedFrame(); |
| EXPECT_EQ(last_format().frame_size.width(), 640); |
| EXPECT_EQ(last_format().frame_size.height(), 480); |
| + EXPECT_EQ((size_t)640*480*3/2, last_format().ImageAllocationSize()); |
|
mcasas
2015/02/03 20:48:46
static_cast
|
| device->StopAndDeAllocate(); |
| } |
| @@ -293,6 +294,9 @@ TEST_F(VideoCaptureDeviceTest, Capture720p) { |
| device->AllocateAndStart(capture_params, client_.Pass()); |
| // Get captured video frames. |
| WaitForCapturedFrame(); |
| + EXPECT_EQ(last_format().frame_size.width(), 1280); |
| + EXPECT_EQ(last_format().frame_size.height(), 720); |
| + EXPECT_EQ((size_t)1280*720*3/2, last_format().ImageAllocationSize()); |
|
mcasas
2015/02/03 20:48:46
idem
|
| device->StopAndDeAllocate(); |
| } |
| @@ -318,6 +322,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_AllocateBadSize) { |
| device->StopAndDeAllocate(); |
| EXPECT_EQ(last_format().frame_size.width(), 640); |
| EXPECT_EQ(last_format().frame_size.height(), 480); |
| + EXPECT_EQ((size_t)640*480*3/2, last_format().ImageAllocationSize()); |
|
mcasas
2015/02/03 20:48:46
idem, and all those remaining if any
|
| } |
| // Cause hangs on Windows Debug. http://crbug.com/417824 |
| @@ -422,6 +427,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_CaptureMjpeg) { |
| // Verify we get MJPEG from the device. Not all devices can capture 1280x720 |
| // @ 30 fps, so we don't care about the exact resolution we get. |
| EXPECT_EQ(last_format().pixel_format, PIXEL_FORMAT_MJPEG); |
| + EXPECT_GE((size_t)1280*720, last_format().ImageAllocationSize()); |
| device->StopAndDeAllocate(); |
| } |