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

Unified Diff: media/video/mock_video_decode_accelerator.h

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a deadlock by calling RGVDF::CreateSharedMemory asynchronously Created 7 years, 6 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: media/video/mock_video_decode_accelerator.h
diff --git a/media/video/mock_video_decode_accelerator.h b/media/video/mock_video_decode_accelerator.h
new file mode 100644
index 0000000000000000000000000000000000000000..613fd11556199d51a723c9b0dc4d685e27a35111
--- /dev/null
+++ b/media/video/mock_video_decode_accelerator.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_VIDEO_MOCK_VIDEO_DECODE_ACCELERATOR_H_
+#define MEDIA_VIDEO_MOCK_VIDEO_DECODE_ACCELERATOR_H_
+
+#include "video_decode_accelerator.h"
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "media/base/bitstream_buffer.h"
+#include "media/base/video_decoder_config.h"
+#include "media/video/picture.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace media {
+
+using ::testing::Invoke;
+
+// Remember to use the default action of Destroy() when using EXPECT_CALL.
+// Otherwise, the mock will be leaked and the test runner will complain.
+class MockVideoDecodeAccelerator : public VideoDecodeAccelerator {
+ public:
+ MockVideoDecodeAccelerator() {
+ // Delete |this| when Destroy() is called.
+ ON_CALL(*this, Destroy())
+ .WillByDefault(Invoke(this, &MockVideoDecodeAccelerator::DeleteThis));
+ }
+ virtual ~MockVideoDecodeAccelerator() {}
+
+ MOCK_METHOD1(Initialize, bool(VideoCodecProfile profile));
+ MOCK_METHOD1(Decode, void(const BitstreamBuffer& bitstream_buffer));
+ MOCK_METHOD1(AssignPictureBuffers,
+ void(const std::vector<PictureBuffer>& buffers));
+ MOCK_METHOD1(ReusePictureBuffer, void(int32 picture_buffer_id));
+ MOCK_METHOD0(Flush, void());
+ MOCK_METHOD0(Reset, void());
+ MOCK_METHOD0(Destroy, void());
+
+ private:
+ void DeleteThis() { delete this; }
+ DISALLOW_COPY_AND_ASSIGN(MockVideoDecodeAccelerator);
+};
+
+} // namespace media
+
+#endif // MEDIA_VIDEO_MOCK_VIDEO_DECODE_ACCELERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698