| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Unit test for VideoCaptureController. | 5 // Unit test for VideoCaptureController. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 client_a_.reset(new MockVideoCaptureControllerEventHandler( | 126 client_a_.reset(new MockVideoCaptureControllerEventHandler( |
| 127 controller_.get())); | 127 controller_.get())); |
| 128 client_b_.reset(new MockVideoCaptureControllerEventHandler( | 128 client_b_.reset(new MockVideoCaptureControllerEventHandler( |
| 129 controller_.get())); | 129 controller_.get())); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void TearDown() override { base::RunLoop().RunUntilIdle(); } | 132 void TearDown() override { base::RunLoop().RunUntilIdle(); } |
| 133 | 133 |
| 134 scoped_refptr<media::VideoFrame> WrapI420Buffer(gfx::Size dimensions, | 134 scoped_refptr<media::VideoFrame> WrapI420Buffer(gfx::Size dimensions, |
| 135 uint8* data) { | 135 uint8* data) { |
| 136 return media::VideoFrame::WrapExternalPackedMemory( | 136 return media::VideoFrame::WrapExternalData( |
| 137 media::VideoFrame::I420, | 137 media::VideoFrame::I420, |
| 138 dimensions, | 138 dimensions, |
| 139 gfx::Rect(dimensions), | 139 gfx::Rect(dimensions), |
| 140 dimensions, | 140 dimensions, |
| 141 data, | 141 data, |
| 142 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions), | 142 media::VideoFrame::AllocationSize(media::VideoFrame::I420, dimensions), |
| 143 base::SharedMemory::NULLHandle(), | |
| 144 0, | |
| 145 base::TimeDelta()); | 143 base::TimeDelta()); |
| 146 } | 144 } |
| 147 | 145 |
| 148 scoped_refptr<media::VideoFrame> WrapMailboxBuffer( | 146 scoped_refptr<media::VideoFrame> WrapMailboxBuffer( |
| 149 const gpu::MailboxHolder& holder, | 147 const gpu::MailboxHolder& holder, |
| 150 const media::VideoFrame::ReleaseMailboxCB& release_cb, | 148 const media::VideoFrame::ReleaseMailboxCB& release_cb, |
| 151 gfx::Size dimensions) { | 149 gfx::Size dimensions) { |
| 152 return media::VideoFrame::WrapNativeTexture( | 150 return media::VideoFrame::WrapNativeTexture( |
| 153 holder, release_cb, dimensions, gfx::Rect(dimensions), dimensions, | 151 holder, release_cb, dimensions, gfx::Rect(dimensions), dimensions, |
| 154 base::TimeDelta(), false /* allow_overlay */, true /* has_alpha */); | 152 base::TimeDelta(), false /* allow_overlay */, true /* has_alpha */); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 EXPECT_EQ(coded_size.width(), size_and_rotation.output_resolution.width()); | 698 EXPECT_EQ(coded_size.width(), size_and_rotation.output_resolution.width()); |
| 701 EXPECT_EQ(coded_size.height(), | 699 EXPECT_EQ(coded_size.height(), |
| 702 size_and_rotation.output_resolution.height()); | 700 size_and_rotation.output_resolution.height()); |
| 703 | 701 |
| 704 EXPECT_EQ(kSessionId, controller_->RemoveClient(route_id, client_a_.get())); | 702 EXPECT_EQ(kSessionId, controller_->RemoveClient(route_id, client_a_.get())); |
| 705 Mock::VerifyAndClearExpectations(client_a_.get()); | 703 Mock::VerifyAndClearExpectations(client_a_.get()); |
| 706 } | 704 } |
| 707 } | 705 } |
| 708 | 706 |
| 709 } // namespace content | 707 } // namespace content |
| OLD | NEW |