1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
6 #define MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/single_thread_task_runner.h"
10 #include "media/renderers/gpu_video_accelerator_factories.h"
11 #include "media/video/video_decode_accelerator.h"
12 #include "media/video/video_encode_accelerator.h"
13 #include "testing/gmock/include/gmock/gmock.h"
24 class MockGpuVideoAcceleratorFactories
: public GpuVideoAcceleratorFactories
{
26 MockGpuVideoAcceleratorFactories();
28 // CreateVideo{Decode,Encode}Accelerator returns scoped_ptr, which the mocking
29 // framework does not want. Trampoline them.
30 MOCK_METHOD0(DoCreateVideoDecodeAccelerator
, VideoDecodeAccelerator
*());
31 MOCK_METHOD0(DoCreateVideoEncodeAccelerator
, VideoEncodeAccelerator
*());
33 MOCK_METHOD5(CreateTextures
,
35 const gfx::Size
& size
,
36 std::vector
<uint32
>* texture_ids
,
37 std::vector
<gpu::Mailbox
>* texture_mailboxes
,
38 uint32 texture_target
));
39 MOCK_METHOD1(DeleteTexture
, void(uint32 texture_id
));
40 MOCK_METHOD1(WaitSyncPoint
, void(uint32 sync_point
));
41 MOCK_METHOD0(GetTaskRunner
, scoped_refptr
<base::SingleThreadTaskRunner
>());
42 MOCK_METHOD0(GetVideoDecodeAcceleratorSupportedProfiles
,
43 VideoDecodeAccelerator::SupportedProfiles());
44 MOCK_METHOD0(GetVideoEncodeAcceleratorSupportedProfiles
,
45 VideoEncodeAccelerator::SupportedProfiles());
47 scoped_ptr
<gfx::GpuMemoryBuffer
> AllocateGpuMemoryBuffer(
48 const gfx::Size
& size
,
49 gfx::GpuMemoryBuffer::Format format
,
50 gfx::GpuMemoryBuffer::Usage usage
) override
;
52 MOCK_METHOD0(IsTextureRGSupported
, bool());
53 MOCK_METHOD0(GetGLES2Interface
, gpu::gles2::GLES2Interface
*());
55 scoped_ptr
<base::SharedMemory
> CreateSharedMemory(size_t size
) override
;
57 scoped_ptr
<VideoDecodeAccelerator
> CreateVideoDecodeAccelerator() override
;
59 scoped_ptr
<VideoEncodeAccelerator
> CreateVideoEncodeAccelerator() override
;
62 ~MockGpuVideoAcceleratorFactories() override
;
64 DISALLOW_COPY_AND_ASSIGN(MockGpuVideoAcceleratorFactories
);
69 #endif // MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_