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 contains definitions for mock objects, used for testing. | 5 // This file contains definitions for mock objects, used for testing. |
6 | 6 |
7 // TODO(apatrick): This file "manually" defines some mock objects. Using gMock | 7 // TODO(apatrick): This file "manually" defines some mock objects. Using gMock |
8 // would be definitely preferable, unfortunately it doesn't work on Windows yet. | 8 // would be definitely preferable, unfortunately it doesn't work on Windows yet. |
9 | 9 |
10 #ifndef GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ | 10 #ifndef GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 GetStringForOptionsThatWouldAffectCompilation, std::string()); | 107 GetStringForOptionsThatWouldAffectCompilation, std::string()); |
108 private: | 108 private: |
109 ~MockShaderTranslator() override; | 109 ~MockShaderTranslator() override; |
110 }; | 110 }; |
111 | 111 |
112 class MockProgramCache : public ProgramCache { | 112 class MockProgramCache : public ProgramCache { |
113 public: | 113 public: |
114 MockProgramCache(); | 114 MockProgramCache(); |
115 virtual ~MockProgramCache(); | 115 virtual ~MockProgramCache(); |
116 | 116 |
117 MOCK_METHOD5(LoadLinkedProgram, ProgramLoadResult( | 117 MOCK_METHOD7(LoadLinkedProgram, ProgramLoadResult( |
118 GLuint program, | 118 GLuint program, |
119 Shader* shader_a, | 119 Shader* shader_a, |
120 Shader* shader_b, | 120 Shader* shader_b, |
121 const LocationMap* bind_attrib_location_map, | 121 const LocationMap* bind_attrib_location_map, |
| 122 const std::vector<std::string>& transform_feedback_varyings, |
| 123 GLenum transform_feedback_buffer_mode, |
122 const ShaderCacheCallback& callback)); | 124 const ShaderCacheCallback& callback)); |
123 | 125 |
124 MOCK_METHOD5(SaveLinkedProgram, void( | 126 MOCK_METHOD7(SaveLinkedProgram, void( |
125 GLuint program, | 127 GLuint program, |
126 const Shader* shader_a, | 128 const Shader* shader_a, |
127 const Shader* shader_b, | 129 const Shader* shader_b, |
128 const LocationMap* bind_attrib_location_map, | 130 const LocationMap* bind_attrib_location_map, |
| 131 const std::vector<std::string>& transform_feedback_varyings, |
| 132 GLenum transform_feedback_buffer_mode, |
129 const ShaderCacheCallback& callback)); | 133 const ShaderCacheCallback& callback)); |
130 MOCK_METHOD1(LoadProgram, void(const std::string&)); | 134 MOCK_METHOD1(LoadProgram, void(const std::string&)); |
131 | 135 |
132 private: | 136 private: |
133 MOCK_METHOD0(ClearBackend, void()); | 137 MOCK_METHOD0(ClearBackend, void()); |
134 }; | 138 }; |
135 | 139 |
136 class MockMemoryTracker : public MemoryTracker { | 140 class MockMemoryTracker : public MemoryTracker { |
137 public: | 141 public: |
138 MockMemoryTracker(); | 142 MockMemoryTracker(); |
139 | 143 |
140 MOCK_METHOD3(TrackMemoryAllocatedChange, void( | 144 MOCK_METHOD3(TrackMemoryAllocatedChange, void( |
141 size_t old_size, size_t new_size, Pool pool)); | 145 size_t old_size, size_t new_size, Pool pool)); |
142 MOCK_METHOD1(EnsureGPUMemoryAvailable, bool(size_t size_needed)); | 146 MOCK_METHOD1(EnsureGPUMemoryAvailable, bool(size_t size_needed)); |
143 | 147 |
144 private: | 148 private: |
145 friend class ::testing::StrictMock<MockMemoryTracker>; | 149 friend class ::testing::StrictMock<MockMemoryTracker>; |
146 friend class base::RefCounted< ::testing::StrictMock<MockMemoryTracker> >; | 150 friend class base::RefCounted< ::testing::StrictMock<MockMemoryTracker> >; |
147 virtual ~MockMemoryTracker(); | 151 virtual ~MockMemoryTracker(); |
148 }; | 152 }; |
149 | 153 |
150 } // namespace gles2 | 154 } // namespace gles2 |
151 } // namespace gpu | 155 } // namespace gpu |
152 | 156 |
153 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ | 157 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ |
OLD | NEW |