• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // BufferImpl_mock.h: Defines a mock of the BufferImpl class.
8 
9 #ifndef LIBANGLE_RENDERER_BUFFERIMPLMOCK_H_
10 #define LIBANGLE_RENDERER_BUFFERIMPLMOCK_H_
11 
12 #include "gmock/gmock.h"
13 
14 #include "libANGLE/Buffer.h"
15 #include "libANGLE/renderer/BufferImpl.h"
16 
17 namespace rx
18 {
19 class MockBufferImpl : public BufferImpl
20 {
21   public:
MockBufferImpl()22     MockBufferImpl() : BufferImpl(mMockState) {}
~MockBufferImpl()23     ~MockBufferImpl() { destructor(); }
24 
25     MOCK_METHOD5(setData,
26                  angle::Result(const gl::Context *,
27                                gl::BufferBinding,
28                                const void *,
29                                size_t,
30                                gl::BufferUsage));
31     MOCK_METHOD5(
32         setSubData,
33         angle::Result(const gl::Context *, gl::BufferBinding, const void *, size_t, size_t));
34     MOCK_METHOD5(copySubData,
35                  angle::Result(const gl::Context *contextImpl,
36                                BufferImpl *,
37                                GLintptr,
38                                GLintptr,
39                                GLsizeiptr));
40     MOCK_METHOD3(map, angle::Result(const gl::Context *contextImpl, GLenum, void **));
41     MOCK_METHOD5(
42         mapRange,
43         angle::Result(const gl::Context *contextImpl, size_t, size_t, GLbitfield, void **));
44     MOCK_METHOD2(unmap, angle::Result(const gl::Context *contextImpl, GLboolean *result));
45 
46     MOCK_METHOD6(getIndexRange,
47                  angle::Result(const gl::Context *,
48                                gl::DrawElementsType,
49                                size_t,
50                                size_t,
51                                bool,
52                                gl::IndexRange *));
53 
54     MOCK_METHOD0(destructor, void());
55 
56   protected:
57     gl::BufferState mMockState;
58 };
59 }  // namespace rx
60 
61 #endif  // LIBANGLE_RENDERER_BUFFERIMPLMOCK_H_
62