OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 implements mock GL Interface for unit testing. The interface | 5 // This file implements mock GL Interface for unit testing. The interface |
6 // corresponds to the set of functionally distinct GL functions defined in | 6 // corresponds to the set of functionally distinct GL functions defined in |
7 // generate_bindings.py, which may originate from either desktop GL or GLES. | 7 // generate_bindings.py, which may originate from either desktop GL or GLES. |
8 | 8 |
9 #ifndef UI_GL_GL_MOCK_H_ | 9 #ifndef UI_GL_GL_MOCK_H_ |
10 #define UI_GL_GL_MOCK_H_ | 10 #define UI_GL_GL_MOCK_H_ |
11 | 11 |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gl { |
16 | 16 |
17 class MockGLInterface { | 17 class MockGLInterface { |
18 public: | 18 public: |
19 MockGLInterface(); | 19 MockGLInterface(); |
20 virtual ~MockGLInterface(); | 20 virtual ~MockGLInterface(); |
21 | 21 |
22 // Set the functions called from the mock GL implementation for the purposes | 22 // Set the functions called from the mock GL implementation for the purposes |
23 // of testing. | 23 // of testing. |
24 static void SetGLInterface(MockGLInterface* gl_interface); | 24 static void SetGLInterface(MockGLInterface* gl_interface); |
25 | 25 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 static MockGLInterface* interface_; | 71 static MockGLInterface* interface_; |
72 | 72 |
73 // Static mock functions that invoke the member functions of interface_. | 73 // Static mock functions that invoke the member functions of interface_. |
74 #include "gl_bindings_autogen_mock.h" | 74 #include "gl_bindings_autogen_mock.h" |
75 | 75 |
76 static void GL_BINDING_CALL Mock_glTexSubImage3DNoData( | 76 static void GL_BINDING_CALL Mock_glTexSubImage3DNoData( |
77 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | 77 GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, |
78 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type); | 78 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace gfx | 81 } // namespace gl |
82 | 82 |
83 #endif // UI_GL_GL_MOCK_H_ | 83 #endif // UI_GL_GL_MOCK_H_ |
OLD | NEW |