OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains the mock GLES2Decoder class. | 5 // This file contains the mock GLES2Decoder class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 12 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 | 16 |
17 namespace gpu { | 17 namespace gpu { |
18 class GLContext; | 18 class GLContext; |
19 | 19 |
20 namespace gles2 { | 20 namespace gles2 { |
21 | 21 |
22 class ContextGroup; | 22 class ContextGroup; |
23 class MockGLES2Decoder : public GLES2Decoder { | 23 class MockGLES2Decoder : public GLES2Decoder { |
24 public: | 24 public: |
25 MockGLES2Decoder(); | 25 MockGLES2Decoder(); |
26 virtual ~MockGLES2Decoder(); | 26 virtual ~MockGLES2Decoder(); |
27 | 27 |
28 MOCK_METHOD6(Initialize, bool(gfx::GLContext* context, | 28 MOCK_METHOD7(Initialize, |
29 const gfx::Size& size, | 29 bool(gfx::GLContext* context, |
30 const char* allowed_extensions, | 30 const gfx::Size& size, |
31 const std::vector<int32>& attribs, | 31 const DisallowedExtensions& disallowed_extensions, |
32 GLES2Decoder* parent, | 32 const char* allowed_extensions, |
33 uint32 parent_texture_id)); | 33 const std::vector<int32>& attribs, |
| 34 GLES2Decoder* parent, |
| 35 uint32 parent_texture_id)); |
34 MOCK_METHOD0(Destroy, void()); | 36 MOCK_METHOD0(Destroy, void()); |
35 MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size)); | 37 MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size)); |
36 MOCK_METHOD0(UpdateOffscreenFrameBufferSize, bool()); | 38 MOCK_METHOD0(UpdateOffscreenFrameBufferSize, bool()); |
37 MOCK_METHOD0(MakeCurrent, bool()); | 39 MOCK_METHOD0(MakeCurrent, bool()); |
38 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); | 40 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); |
39 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); | 41 MOCK_METHOD0(GetGLES2Util, GLES2Util*()); |
40 MOCK_METHOD0(GetGLContext, gfx::GLContext*()); | 42 MOCK_METHOD0(GetGLContext, gfx::GLContext*()); |
41 MOCK_METHOD0(GetContextGroup, ContextGroup*()); | 43 MOCK_METHOD0(GetContextGroup, ContextGroup*()); |
42 MOCK_METHOD1(SetResizeCallback, void(Callback1<gfx::Size>::Type*)); | 44 MOCK_METHOD1(SetResizeCallback, void(Callback1<gfx::Size>::Type*)); |
43 MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); | 45 MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); |
44 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, | 46 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, |
45 unsigned int arg_count, | 47 unsigned int arg_count, |
46 const void* cmd_data)); | 48 const void* cmd_data)); |
47 MOCK_METHOD2(GetServiceTextureId, bool(uint32 client_texture_id, | 49 MOCK_METHOD2(GetServiceTextureId, bool(uint32 client_texture_id, |
48 uint32* service_texture_id)); | 50 uint32* service_texture_id)); |
49 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); | 51 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); | 53 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); |
52 }; | 54 }; |
53 | 55 |
54 } // namespace gles2 | 56 } // namespace gles2 |
55 } // namespace gpu | 57 } // namespace gpu |
56 | 58 |
57 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 59 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
OLD | NEW |