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

Unified Diff: content/browser/media/capture/desktop_capture_device_unittest.cc

Issue 1064963002: VideoCapture: add support for GpuMemoryBuffer allocation and lifetime mgmt in VideoCaptureBufferPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: VideoCaptureDevice::Client::Buffer::~Buffer() pure virtual. Avoid using base::MessageLoopProxy::cur… Created 5 years, 8 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
Index: content/browser/media/capture/desktop_capture_device_unittest.cc
diff --git a/content/browser/media/capture/desktop_capture_device_unittest.cc b/content/browser/media/capture/desktop_capture_device_unittest.cc
index 1a874f451e1fd8957e32cde8521126b140664a76..c86ddd3857ec569b9c6a11a54a3d2845b621ecdd 100644
--- a/content/browser/media/capture/desktop_capture_device_unittest.cc
+++ b/content/browser/media/capture/desktop_capture_device_unittest.cc
@@ -69,14 +69,28 @@ class MockDeviceClient : public media::VideoCaptureDevice::Client {
const media::VideoCaptureFormat& frame_format,
int clockwise_rotation,
const base::TimeTicks& timestamp));
- MOCK_METHOD2(ReserveOutputBuffer,
- scoped_refptr<Buffer>(media::VideoPixelFormat format,
- const gfx::Size& dimensions));
- MOCK_METHOD3(OnIncomingCapturedVideoFrame,
- void(const scoped_refptr<Buffer>& buffer,
- const scoped_refptr<media::VideoFrame>& frame,
- const base::TimeTicks& timestamp));
+ MOCK_METHOD0(DoReserveOutputBuffer, void(void));
+ MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
+ MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void));
MOCK_METHOD1(OnError, void(const std::string& reason));
+
+ // Trampoline methods to workaround GMOCK problems with scoped_ptr<>.
+ scoped_ptr<Buffer> ReserveOutputBuffer(media::VideoPixelFormat format,
+ const gfx::Size& dimensions) override {
+ DoReserveOutputBuffer();
+ return scoped_ptr<Buffer>();
+ }
+ void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer,
+ const media::VideoCaptureFormat& frame_format,
+ const base::TimeTicks& timestamp) override {
+ DoOnIncomingCapturedBuffer();
+ }
+ void OnIncomingCapturedVideoFrame(
+ scoped_ptr<Buffer> buffer,
+ const scoped_refptr<media::VideoFrame>& frame,
+ const base::TimeTicks& timestamp) override {
+ DoOnIncomingCapturedVideoFrame();
+ }
};
// Creates a DesktopFrame that has the first pixel bytes set to

Powered by Google App Engine
This is Rietveld 408576698