| Index: content/browser/renderer_host/media/video_capture_controller_unittest.cc
|
| diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
|
| index 9af6feeae0daabc0040d1c05f58631584a063ac5..c921fb7aa70068e6697f9c415fee5342ebd40e26 100644
|
| --- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
|
| @@ -117,11 +117,14 @@ class VideoCaptureControllerTest : public testing::Test {
|
|
|
| scoped_refptr<media::VideoFrame> WrapI420Buffer(gfx::Size dimensions,
|
| uint8* data) {
|
| - return media::VideoFrame::WrapExternalSharedMemory(
|
| - media::PIXEL_FORMAT_I420, dimensions, gfx::Rect(dimensions), dimensions,
|
| - data,
|
| - media::VideoFrame::AllocationSize(media::PIXEL_FORMAT_I420, dimensions),
|
| - base::SharedMemory::NULLHandle(), 0u, base::TimeDelta());
|
| + scoped_refptr<media::VideoFrame> video_frame =
|
| + media::VideoFrame::WrapExternalSharedMemory(
|
| + media::PIXEL_FORMAT_I420, dimensions, gfx::Rect(dimensions),
|
| + dimensions, data, media::VideoFrame::AllocationSize(
|
| + media::PIXEL_FORMAT_I420, dimensions),
|
| + base::SharedMemory::NULLHandle(), 0u, base::TimeDelta());
|
| + CHECK(video_frame);
|
| + return video_frame;
|
| }
|
|
|
| TestBrowserThreadBundle bundle_;
|
| @@ -312,6 +315,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
|
| }
|
| scoped_refptr<media::VideoFrame> video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer->data()));
|
| + CHECK(video_frame);
|
| ASSERT_FALSE(video_frame->metadata()->HasKey(
|
| media::VideoFrameMetadata::RESOURCE_UTILIZATION));
|
| client_a_->resource_utilization_ = 0.5;
|
| @@ -341,6 +345,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
|
| memset(buffer2->data(), buffer_no++, buffer2->mapped_size());
|
| video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer2->data()));
|
| + CHECK(video_frame);
|
| ASSERT_FALSE(video_frame->metadata()->HasKey(
|
| media::VideoFrameMetadata::RESOURCE_UTILIZATION));
|
| client_a_->resource_utilization_ = 0.5;
|
| @@ -387,6 +392,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
|
| memset(buffer->data(), buffer_no++, buffer->mapped_size());
|
| video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer->data()));
|
| + CHECK(video_frame);
|
| device_->OnIncomingCapturedVideoFrame(buffer.Pass(), video_frame,
|
| base::TimeTicks());
|
| }
|
| @@ -435,6 +441,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
|
| memset(buffer3->data(), buffer_no++, buffer3->mapped_size());
|
| video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer3->data()));
|
| + CHECK(video_frame);
|
| device_->OnIncomingCapturedVideoFrame(buffer3.Pass(), video_frame,
|
| base::TimeTicks());
|
|
|
| @@ -452,6 +459,7 @@ TEST_F(VideoCaptureControllerTest, NormalCaptureMultipleClients) {
|
| memset(buffer4->data(), buffer_no++, buffer4->mapped_size());
|
| video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer4->data()));
|
| + CHECK(video_frame);
|
| device_->OnIncomingCapturedVideoFrame(buffer4.Pass(), video_frame,
|
| base::TimeTicks());
|
| // B2 is the only client left, and is the only one that should
|
| @@ -500,6 +508,7 @@ TEST_F(VideoCaptureControllerTest, ErrorBeforeDeviceCreation) {
|
| ASSERT_TRUE(buffer.get());
|
| scoped_refptr<media::VideoFrame> video_frame =
|
| WrapI420Buffer(capture_resolution, static_cast<uint8*>(buffer->data()));
|
| + CHECK(video_frame);
|
| device_->OnIncomingCapturedVideoFrame(buffer.Pass(), video_frame,
|
| base::TimeTicks());
|
|
|
| @@ -537,6 +546,7 @@ TEST_F(VideoCaptureControllerTest, ErrorAfterDeviceCreation) {
|
|
|
| scoped_refptr<media::VideoFrame> video_frame =
|
| WrapI420Buffer(dims, static_cast<uint8*>(buffer->data()));
|
| + CHECK(video_frame);
|
| device_->OnError(FROM_HERE, "Test Error");
|
| device_->OnIncomingCapturedVideoFrame(buffer.Pass(), video_frame,
|
| base::TimeTicks());
|
|
|