| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 | 12 |
| 13 namespace gpu { | 13 namespace gpu { |
| 14 namespace gles2 { | 14 namespace gles2 { |
| 15 | 15 |
| 16 class MockGLES2Decoder : public GLES2Decoder { | 16 class MockGLES2Decoder : public GLES2Decoder { |
| 17 public: | 17 public: |
| 18 MockGLES2Decoder() { | 18 MockGLES2Decoder() { |
| 19 ON_CALL(*this, GetCommandName(testing::_)) | 19 ON_CALL(*this, GetCommandName(testing::_)) |
| 20 .WillByDefault(testing::Return("")); | 20 .WillByDefault(testing::Return("")); |
| 21 ON_CALL(*this, MakeCurrent()) | 21 ON_CALL(*this, MakeCurrent()) |
| 22 .WillByDefault(testing::Return(true)); | 22 .WillByDefault(testing::Return(true)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 MOCK_METHOD0(Initialize, bool()); | 25 MOCK_METHOD0(Initialize, bool()); |
| 26 MOCK_METHOD0(Destroy, void()); | 26 MOCK_METHOD0(Destroy, void()); |
| 27 MOCK_METHOD0(MakeCurrent, bool()); | 27 MOCK_METHOD0(MakeCurrent, bool()); |
| 28 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); | 28 MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); |
| 29 MOCK_METHOD1(SetSwapBuffersCallback, void(Callback0::Type*)); |
| 29 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, | 30 MOCK_METHOD3(DoCommand, error::Error(unsigned int command, |
| 30 unsigned int arg_count, | 31 unsigned int arg_count, |
| 31 const void* cmd_data)); | 32 const void* cmd_data)); |
| 32 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); | 33 MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); |
| 33 | 34 |
| 34 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); | 35 DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 } // namespace gles2 | 38 } // namespace gles2 |
| 38 } // namespace gpu | 39 } // namespace gpu |
| 39 | 40 |
| 40 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ | 41 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_ |
| OLD | NEW |