Chromium Code Reviews| Index: media/base/video_frame_unittest.cc |
| diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc |
| index f1afcc8186c18039eceaf4e15bd6a9b415ca4f3b..273c9f755f819d18dbb2d333d832709aa6a559c9 100644 |
| --- a/media/base/video_frame_unittest.cc |
| +++ b/media/base/video_frame_unittest.cc |
| @@ -158,6 +158,24 @@ TEST(VideoFrame, CreateFrame) { |
| frame->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM)); |
| } |
| +TEST(VideoFrame, CreateZeroInitializedFrame) { |
| + const int kWidth = 2; |
| + const int kHeight = 2; |
| + const base::TimeDelta kTimestamp = base::TimeDelta::FromMicroseconds(1337); |
| + |
| + // Create a YV12 Video Frame. |
| + gfx::Size size(kWidth, kHeight); |
| + scoped_refptr<media::VideoFrame> frame = |
| + VideoFrame::CreateZeroInitializedFrame(media::PIXEL_FORMAT_YV12, size, |
| + gfx::Rect(size), size, kTimestamp); |
| + ASSERT_TRUE(frame.get()); |
| + EXPECT_TRUE(frame->IsMappable()); |
| + |
| + // Verify that frame is initialized with zeros. |
| + for (size_t i = 0; i < VideoFrame::NumPlanes(frame->format()); ++i) |
|
mcasas
2015/09/05 01:29:25
nit: please add a TODO to extend this part here
to
emircan
2015/09/05 01:39:50
Done.
|
| + EXPECT_EQ(0, frame->data(i)[0]); |
| +} |
| + |
| TEST(VideoFrame, CreateBlackFrame) { |
| const int kWidth = 2; |
| const int kHeight = 2; |