| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 public: | 89 public: |
| 90 MockShaderTranslator(); | 90 MockShaderTranslator(); |
| 91 virtual ~MockShaderTranslator(); | 91 virtual ~MockShaderTranslator(); |
| 92 | 92 |
| 93 MOCK_METHOD5(Init, bool( | 93 MOCK_METHOD5(Init, bool( |
| 94 sh::GLenum shader_type, | 94 sh::GLenum shader_type, |
| 95 ShShaderSpec shader_spec, | 95 ShShaderSpec shader_spec, |
| 96 const ShBuiltInResources* resources, | 96 const ShBuiltInResources* resources, |
| 97 GlslImplementationType glsl_implementation_type, | 97 GlslImplementationType glsl_implementation_type, |
| 98 ShCompileOptions driver_bug_workarounds)); | 98 ShCompileOptions driver_bug_workarounds)); |
| 99 MOCK_METHOD1(Translate, bool(const char* shader)); | 99 MOCK_CONST_METHOD7(Translate, bool( |
| 100 MOCK_CONST_METHOD0(translated_shader, const char*()); | 100 const std::string& shader_source, |
| 101 MOCK_CONST_METHOD0(info_log, const char*()); | 101 std::string* info_log, |
| 102 MOCK_CONST_METHOD0(attrib_map, const VariableMap&()); | 102 std::string* translated_source, |
| 103 MOCK_CONST_METHOD0(uniform_map, const VariableMap&()); | 103 VariableMap* attrib_map, |
| 104 MOCK_CONST_METHOD0(varying_map, const VariableMap&()); | 104 VariableMap* uniform_map, |
| 105 MOCK_CONST_METHOD0(name_map, const NameMap&()); | 105 VariableMap* varying_map, |
| 106 NameMap* name_map)); |
| 106 MOCK_CONST_METHOD0( | 107 MOCK_CONST_METHOD0( |
| 107 GetStringForOptionsThatWouldAffectCompilation, std::string()); | 108 GetStringForOptionsThatWouldAffectCompilation, std::string()); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 class MockProgramCache : public ProgramCache { | 111 class MockProgramCache : public ProgramCache { |
| 111 public: | 112 public: |
| 112 MockProgramCache(); | 113 MockProgramCache(); |
| 113 virtual ~MockProgramCache(); | 114 virtual ~MockProgramCache(); |
| 114 | 115 |
| 115 MOCK_METHOD7(LoadLinkedProgram, ProgramLoadResult( | 116 MOCK_METHOD7(LoadLinkedProgram, ProgramLoadResult( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 146 private: | 147 private: |
| 147 friend class ::testing::StrictMock<MockMemoryTracker>; | 148 friend class ::testing::StrictMock<MockMemoryTracker>; |
| 148 friend class base::RefCounted< ::testing::StrictMock<MockMemoryTracker> >; | 149 friend class base::RefCounted< ::testing::StrictMock<MockMemoryTracker> >; |
| 149 virtual ~MockMemoryTracker(); | 150 virtual ~MockMemoryTracker(); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace gles2 | 153 } // namespace gles2 |
| 153 } // namespace gpu | 154 } // namespace gpu |
| 154 | 155 |
| 155 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ | 156 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ |
| OLD | NEW |