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

Side by Side Diff: gpu/command_buffer/common/command_buffer_mock.h

Issue 555020: Redesigned CommandBuffer and NPDevice3D interfaces (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/common/constants.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ 5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ 6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
7 7
8 #include "gpu/command_buffer/common/command_buffer.h" 8 #include "gpu/command_buffer/common/command_buffer.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 10
11 namespace gpu { 11 namespace gpu {
12 12
13 // An NPObject that implements a shared memory command buffer and a synchronous 13 // An NPObject that implements a shared memory command buffer and a synchronous
14 // API to manage the put and get pointers. 14 // API to manage the put and get pointers.
15 class MockCommandBuffer : public CommandBuffer { 15 class MockCommandBuffer : public CommandBuffer {
16 public: 16 public:
17 MockCommandBuffer() { 17 MockCommandBuffer() {
18 ON_CALL(*this, GetRingBuffer()) 18 ON_CALL(*this, GetRingBuffer())
19 .WillByDefault(testing::Return(Buffer())); 19 .WillByDefault(testing::Return(Buffer()));
20 ON_CALL(*this, GetTransferBuffer(testing::_)) 20 ON_CALL(*this, GetTransferBuffer(testing::_))
21 .WillByDefault(testing::Return(Buffer())); 21 .WillByDefault(testing::Return(Buffer()));
22 } 22 }
23 23
24 MOCK_METHOD1(Initialize, bool(int32 size)); 24 MOCK_METHOD1(Initialize, bool(int32 size));
25 MOCK_METHOD0(GetRingBuffer, Buffer()); 25 MOCK_METHOD0(GetRingBuffer, Buffer());
26 MOCK_METHOD0(GetSize, int32()); 26 MOCK_METHOD0(GetState, State());
27 MOCK_METHOD1(SyncOffsets, int32(int32 put_offset)); 27 MOCK_METHOD1(Flush, State(int32 put_offset));
28 MOCK_METHOD0(GetGetOffset, int32());
29 MOCK_METHOD1(SetGetOffset, void(int32 get_offset)); 28 MOCK_METHOD1(SetGetOffset, void(int32 get_offset));
30 MOCK_METHOD0(GetPutOffset, int32());
31 MOCK_METHOD1(CreateTransferBuffer, int32(size_t size)); 29 MOCK_METHOD1(CreateTransferBuffer, int32(size_t size));
32 MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle)); 30 MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle));
33 MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle)); 31 MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle));
34 MOCK_METHOD0(GetToken, int32());
35 MOCK_METHOD1(SetToken, void(int32 token)); 32 MOCK_METHOD1(SetToken, void(int32 token));
36 MOCK_METHOD0(ResetParseError, int32()); 33 MOCK_METHOD1(SetParseError, void(parse_error::ParseError parse_error));
37 MOCK_METHOD1(SetParseError, void(int32 parse_erro));
38 MOCK_METHOD0(GetErrorStatus, bool());
39 MOCK_METHOD0(RaiseErrorStatus, void());
40 34
41 private: 35 private:
42 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer); 36 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer);
43 }; 37 };
44 38
45 } // namespace gpu 39 } // namespace gpu
46 40
47 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_ 41 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/command_buffer.h ('k') | gpu/command_buffer/common/constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698