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

Unified Diff: cc/resources/video_resource_updater_unittest.cc

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LOG in video_Frame and CHECK/return outside. Created 5 years 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 | « cc/layers/video_layer_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater_unittest.cc
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index 689de6817943dc7c92ebdc73fd96b289fea1ccc4..72107b8769a24f5b302a4fc2b7eb6eb8259f58e3 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -84,18 +84,21 @@ class VideoResourceUpdaterTest : public testing::Test {
static uint8 u_data[kDimension * kDimension / 2] = { 0 };
static uint8 v_data[kDimension * kDimension / 2] = { 0 };
- return media::VideoFrame::WrapExternalYuvData(
- media::PIXEL_FORMAT_YV16, // format
- size, // coded_size
- gfx::Rect(size), // visible_rect
- size, // natural_size
- size.width(), // y_stride
- size.width() / 2, // u_stride
- size.width() / 2, // v_stride
- y_data, // y_data
- u_data, // u_data
- v_data, // v_data
- base::TimeDelta()); // timestamp
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::WrapExternalYuvData(
+ media::PIXEL_FORMAT_YV16, // format
+ size, // coded_size
+ gfx::Rect(size), // visible_rect
+ size, // natural_size
+ size.width(), // y_stride
+ size.width() / 2, // u_stride
+ size.width() / 2, // v_stride
+ y_data, // y_data
+ u_data, // u_data
+ v_data, // v_data
+ base::TimeDelta()); // timestamp
+ CHECK(video_frame);
+ return video_frame;
}
static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {}
@@ -109,14 +112,17 @@ class VideoResourceUpdaterTest : public testing::Test {
const gpu::SyncToken sync_token(7);
const unsigned target = GL_TEXTURE_2D;
- return media::VideoFrame::WrapNativeTexture(
- media::PIXEL_FORMAT_ARGB,
- gpu::MailboxHolder(mailbox, sync_token, target),
- base::Bind(&ReleaseMailboxCB),
- size, // coded_size
- gfx::Rect(size), // visible_rect
- size, // natural_size
- base::TimeDelta()); // timestamp
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::WrapNativeTexture(
+ media::PIXEL_FORMAT_ARGB,
+ gpu::MailboxHolder(mailbox, sync_token, target),
+ base::Bind(&ReleaseMailboxCB),
+ size, // coded_size
+ gfx::Rect(size), // visible_rect
+ size, // natural_size
+ base::TimeDelta()); // timestamp
+ CHECK(video_frame);
+ return video_frame;
}
scoped_refptr<media::VideoFrame> CreateTestYUVHardareVideoFrame() {
@@ -130,18 +136,21 @@ class VideoResourceUpdaterTest : public testing::Test {
}
const gpu::SyncToken sync_token(7);
const unsigned target = GL_TEXTURE_RECTANGLE_ARB;
- return media::VideoFrame::WrapYUV420NativeTextures(
- gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token,
- target),
- gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token,
- target),
- gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token,
- target),
- base::Bind(&ReleaseMailboxCB),
- size, // coded_size
- gfx::Rect(size), // visible_rect
- size, // natural_size
- base::TimeDelta()); // timestamp
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::WrapYUV420NativeTextures(
+ gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token,
+ target),
+ gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token,
+ target),
+ gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token,
+ target),
+ base::Bind(&ReleaseMailboxCB),
+ size, // coded_size
+ gfx::Rect(size), // visible_rect
+ size, // natural_size
+ base::TimeDelta()); // timestamp
+ CHECK(video_frame);
mcasas 2015/12/15 17:14:33 Prefer ASSERT_xx() to CHECK (see last entry in [1]
emircan 2015/12/16 15:57:10 Thanks, changing all to ASSERT_TRUE.
+ return video_frame;
}
WebGraphicsContext3DUploadCounter* context3d_;
« no previous file with comments | « cc/layers/video_layer_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698