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

Unified Diff: media/base/video_frame_unittest.cc

Issue 383893002: Zero initialize the first allocation of a VideoFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame_unittest.cc
diff --git a/media/base/video_frame_unittest.cc b/media/base/video_frame_unittest.cc
index 618d68f458f774de68fc2792e3e6693247308eae..199e1bf96ea213130300f13ce23db84862351487 100644
--- a/media/base/video_frame_unittest.cc
+++ b/media/base/video_frame_unittest.cc
@@ -308,4 +308,17 @@ TEST(VideoFrame, TextureNoLongerNeededCallbackAfterTakingAndReleasingMailbox) {
EXPECT_EQ(release_sync_points, called_sync_points);
}
+TEST(VideoFrame, ZeroInitialized) {
+ const int kWidth = 64;
+ const int kHeight = 48;
+ const base::TimeDelta kTimestamp = base::TimeDelta::FromMicroseconds(1337);
+
+ gfx::Size size(kWidth, kHeight);
+ scoped_refptr<media::VideoFrame> frame = VideoFrame::CreateFrame(
+ media::VideoFrame::YV12, size, gfx::Rect(size), size, kTimestamp);
+
+ for (size_t i = 0; i < VideoFrame::NumPlanes(frame->format()); ++i)
+ EXPECT_EQ(0, frame->data(i)[0]);
+}
+
} // namespace media
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698