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

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

Issue 1176613003: Fixing formats for Video Capture Device unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas@ comments. Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ae4ef5c07d9e9bdaf2eb9e006e98a8ac5e5b9b3..a89385bd05da432985dbe02c6876cfb92831f981 100644
--- a/media/video/capture/video_capture_device_unittest.cc
+++ b/media/video/capture/video_capture_device_unittest.cc
@@ -322,8 +322,7 @@ TEST_P(VideoCaptureDeviceTest, CaptureWithSize) {
EXPECT_EQ(last_format().frame_size.width(), width);
EXPECT_EQ(last_format().frame_size.height(), height);
if (last_format().pixel_format != PIXEL_FORMAT_MJPEG)
- EXPECT_LE(static_cast<size_t>(width * height * 3 / 2),
- last_format().ImageAllocationSize());
+ EXPECT_EQ(size.GetArea(), last_format().frame_size.GetArea());
device->StopAndDeAllocate();
}
@@ -345,6 +344,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_AllocateBadSize) {
EXPECT_CALL(*client_, OnError(_)).Times(0);
+ const gfx::Size input_size(640, 480);
VideoCaptureParams capture_params;
capture_params.requested_format.frame_size.SetSize(637, 472);
capture_params.requested_format.frame_rate = 35;
@@ -352,10 +352,10 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_AllocateBadSize) {
device->AllocateAndStart(capture_params, client_.Pass());
WaitForCapturedFrame();
device->StopAndDeAllocate();
- EXPECT_EQ(last_format().frame_size.width(), 640);
- EXPECT_EQ(last_format().frame_size.height(), 480);
- EXPECT_EQ(static_cast<size_t>(640 * 480 * 3 / 2),
- last_format().ImageAllocationSize());
+ EXPECT_EQ(last_format().frame_size.width(), input_size.width());
+ EXPECT_EQ(last_format().frame_size.height(), input_size.height());
+ if (last_format().pixel_format != PIXEL_FORMAT_MJPEG)
+ EXPECT_EQ(input_size.GetArea(), last_format().frame_size.GetArea());
}
// Cause hangs on Windows Debug. http://crbug.com/417824
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698