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

Side by Side Diff: o3d/gpu_plugin/command_buffer_mock.h

Issue 234001: GPUProcessor uses O3D command buffer service to render to a window.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « o3d/gpu_plugin/command_buffer.cc ('k') | o3d/gpu_plugin/command_buffer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_ 5 #ifndef O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_
6 #define O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_ 6 #define O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_
7 7
8 #include "o3d/gpu_plugin/command_buffer.h" 8 #include "o3d/gpu_plugin/command_buffer.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
11 namespace o3d { 11 namespace o3d {
12 namespace gpu_plugin { 12 namespace gpu_plugin {
13 13
14 // An NPObject that implements a shared memory command buffer and a synchronous 14 // An NPObject that implements a shared memory command buffer and a synchronous
15 // API to manage the put and get pointers. 15 // API to manage the put and get pointers.
16 class MockCommandBuffer : public CommandBuffer { 16 class MockCommandBuffer : public CommandBuffer {
17 public: 17 public:
18 explicit MockCommandBuffer(NPP npp) : CommandBuffer(npp) { 18 explicit MockCommandBuffer(NPP npp) : CommandBuffer(npp) {
19 ON_CALL(*this, GetRingBuffer())
20 .WillByDefault(testing::Return(NPObjectPointer<CHRSharedMemory>()));
21 ON_CALL(*this, GetRegisteredObject(testing::_))
22 .WillByDefault(testing::Return(NPObjectPointer<NPObject>()));
19 } 23 }
20 24
21 MOCK_METHOD1(Initialize, bool(int32)); 25 MOCK_METHOD1(Initialize, bool(int32 size));
22 MOCK_METHOD0(GetRingBuffer, NPObjectPointer<CHRSharedMemory>()); 26 MOCK_METHOD0(GetRingBuffer, NPObjectPointer<CHRSharedMemory>());
23 MOCK_METHOD0(GetSize, int32()); 27 MOCK_METHOD0(GetSize, int32());
24 MOCK_METHOD1(SyncOffsets, int32(int32)); 28 MOCK_METHOD1(SyncOffsets, int32(int32 put_offset));
25 MOCK_METHOD0(GetGetOffset, int32()); 29 MOCK_METHOD0(GetGetOffset, int32());
26 MOCK_METHOD1(SetGetOffset, void(int32)); 30 MOCK_METHOD1(SetGetOffset, void(int32 get_offset));
27 MOCK_METHOD0(GetPutOffset, int32()); 31 MOCK_METHOD0(GetPutOffset, int32());
28 MOCK_METHOD1(SetPutOffsetChangeCallback, void(Callback0::Type*)); 32 MOCK_METHOD1(SetPutOffsetChangeCallback, void(Callback0::Type* callback));
29 MOCK_METHOD1(RegisterObject, int32(NPObjectPointer<NPObject>)); 33 MOCK_METHOD1(RegisterObject, int32(NPObjectPointer<NPObject> object));
30 MOCK_METHOD2(UnregisterObject, void(NPObjectPointer<NPObject>, int32)); 34 MOCK_METHOD2(UnregisterObject, void(NPObjectPointer<NPObject> object,
31 MOCK_METHOD0(GetRegisteredObject, NPObjectPointer<NPObject>()); 35 int32 handle));
36 MOCK_METHOD1(GetRegisteredObject, NPObjectPointer<NPObject>(int32 handle));
32 37
33 private: 38 private:
34 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer); 39 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer);
35 }; 40 };
36 41
37 } // namespace gpu_plugin 42 } // namespace gpu_plugin
38 } // namespace o3d 43 } // namespace o3d
39 44
40 #endif // O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_ 45 #endif // O3D_GPU_PLUGIN_COMMAND_BUFFER_MOCK_H_
OLDNEW
« no previous file with comments | « o3d/gpu_plugin/command_buffer.cc ('k') | o3d/gpu_plugin/command_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698