Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / gpu / command_buffer / common / command_buffer_mock.h
blobb7366f8c47fd7e65587b864d30d3aee3ed06923f
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
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
6 #define GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_
8 #include "gpu/command_buffer/service/command_buffer_service.h"
9 #include "testing/gmock/include/gmock/gmock.h"
11 namespace base {
12 class SharedMemory;
15 namespace gpu {
17 // An NPObject that implements a shared memory command buffer and a synchronous
18 // API to manage the put and get pointers.
19 class MockCommandBuffer : public CommandBufferServiceBase {
20 public:
21 MockCommandBuffer();
22 virtual ~MockCommandBuffer();
24 MOCK_METHOD0(Initialize, bool());
25 MOCK_METHOD0(GetLastState, State());
26 MOCK_METHOD0(GetLastToken, int32());
27 MOCK_METHOD1(Flush, void(int32 put_offset));
28 MOCK_METHOD2(WaitForTokenInRange, void(int32 start, int32 end));
29 MOCK_METHOD2(WaitForGetOffsetInRange, void(int32 start, int32 end));
30 MOCK_METHOD1(SetGetBuffer, void(int32 transfer_buffer_id));
31 MOCK_METHOD1(SetGetOffset, void(int32 get_offset));
32 MOCK_METHOD2(CreateTransferBuffer,
33 scoped_refptr<gpu::Buffer>(size_t size, int32* id));
34 MOCK_METHOD1(DestroyTransferBuffer, void(int32 id));
35 MOCK_METHOD1(GetTransferBuffer, scoped_refptr<gpu::Buffer>(int32 id));
36 MOCK_METHOD1(SetToken, void(int32 token));
37 MOCK_METHOD1(SetParseError, void(error::Error error));
38 MOCK_METHOD1(SetContextLostReason,
39 void(error::ContextLostReason context_lost_reason));
40 MOCK_METHOD0(InsertSyncPoint, uint32());
41 MOCK_METHOD0(GetPutOffset, int32());
43 private:
44 DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer);
47 } // namespace gpu
49 #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_MOCK_H_