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
<base::SharedMemory
> CreateSharedMemory(size_t size
) override
;
49 virtual scoped_ptr
<VideoDecodeAccelerator
> CreateVideoDecodeAccelerator()
52 virtual scoped_ptr
<VideoEncodeAccelerator
> CreateVideoEncodeAccelerator()
56 virtual ~MockGpuVideoAcceleratorFactories();
58 DISALLOW_COPY_AND_ASSIGN(MockGpuVideoAcceleratorFactories
);
63 #endif // MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_