Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: gpu/command_buffer/service/mocks.h

Issue 7058035: WebGraphicsContext3DCommandBufferImpl cleanup, Canvas2D thottling fix, GpuScheduler fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests and feedback Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Forwards the SetToken commands to the engine. 63 // Forwards the SetToken commands to the engine.
64 void SetToken(unsigned int command, 64 void SetToken(unsigned int command,
65 unsigned int arg_count, 65 unsigned int arg_count,
66 const void* _args); 66 const void* _args);
67 67
68 private: 68 private:
69 CommandBufferEngine *engine_; 69 CommandBufferEngine *engine_;
70 }; 70 };
71 71
72 class SpecializedAsyncAPIMock : public AsyncAPIMock {
73 public:
74 static const unsigned int kTestPauseCommand = 333;
75
76 SpecializedAsyncAPIMock();
77 virtual ~SpecializedAsyncAPIMock();
78
79 virtual error::Error DoCommand(unsigned int command,
80 unsigned int arg_count,
81 const void* cmd_data);
82 };
83
72 namespace gles2 { 84 namespace gles2 {
73 85
74 class MockShaderTranslator : public ShaderTranslatorInterface { 86 class MockShaderTranslator : public ShaderTranslatorInterface {
75 public: 87 public:
76 MockShaderTranslator(); 88 MockShaderTranslator();
77 virtual ~MockShaderTranslator(); 89 virtual ~MockShaderTranslator();
78 90
79 MOCK_METHOD4(Init, bool( 91 MOCK_METHOD4(Init, bool(
80 ShShaderType shader_type, 92 ShShaderType shader_type,
81 ShShaderSpec shader_spec, 93 ShShaderSpec shader_spec,
82 const ShBuiltInResources* resources, 94 const ShBuiltInResources* resources,
83 bool implementation_is_glsl_es)); 95 bool implementation_is_glsl_es));
84 MOCK_METHOD1(Translate, bool(const char* shader)); 96 MOCK_METHOD1(Translate, bool(const char* shader));
85 MOCK_CONST_METHOD0(translated_shader, const char*()); 97 MOCK_CONST_METHOD0(translated_shader, const char*());
86 MOCK_CONST_METHOD0(info_log, const char*()); 98 MOCK_CONST_METHOD0(info_log, const char*());
87 MOCK_CONST_METHOD0(attrib_map, const VariableMap&()); 99 MOCK_CONST_METHOD0(attrib_map, const VariableMap&());
88 MOCK_CONST_METHOD0(uniform_map, const VariableMap&()); 100 MOCK_CONST_METHOD0(uniform_map, const VariableMap&());
89 }; 101 };
90 102
91 } // namespace gles2 103 } // namespace gles2
92 } // namespace gpu 104 } // namespace gpu
93 105
94 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ 106 #endif // GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698