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 // Helper classes for implementing gpu client side unit tests. | 5 // Helper classes for implementing gpu client side unit tests. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ |
8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ | 8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 #include <stdint.h> | 11 #include <stdint.h> |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 | 14 |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "gpu/command_buffer/client/gpu_control.h" | 17 #include "gpu/command_buffer/client/gpu_control.h" |
18 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 18 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
19 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 19 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
20 #include "gpu/command_buffer/common/sync_token.h" | 20 #include "gpu/command_buffer/common/sync_token.h" |
21 #include "gpu/command_buffer/service/command_buffer_service.h" | 21 #include "gpu/command_buffer/service/command_buffer_service.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/latency/latency_info.h" |
24 | 25 |
25 namespace gpu { | 26 namespace gpu { |
26 | 27 |
27 class MockCommandBufferBase : public CommandBufferServiceBase { | 28 class MockCommandBufferBase : public CommandBufferServiceBase { |
28 public: | 29 public: |
29 static const int32_t kTransferBufferBaseId = 0x123; | 30 static const int32_t kTransferBufferBaseId = 0x123; |
30 static const int32_t kMaxTransferBuffers = 32; | 31 static const int32_t kMaxTransferBuffers = 32; |
31 | 32 |
32 MockCommandBufferBase(); | 33 MockCommandBufferBase(); |
33 ~MockCommandBufferBase() override; | 34 ~MockCommandBufferBase() override; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 MOCK_CONST_METHOD0(GetExtraCommandBufferData, int32_t()); | 113 MOCK_CONST_METHOD0(GetExtraCommandBufferData, int32_t()); |
113 MOCK_METHOD0(GenerateFenceSyncRelease, uint64_t()); | 114 MOCK_METHOD0(GenerateFenceSyncRelease, uint64_t()); |
114 MOCK_METHOD1(IsFenceSyncRelease, bool(uint64_t release)); | 115 MOCK_METHOD1(IsFenceSyncRelease, bool(uint64_t release)); |
115 MOCK_METHOD1(IsFenceSyncFlushed, bool(uint64_t release)); | 116 MOCK_METHOD1(IsFenceSyncFlushed, bool(uint64_t release)); |
116 MOCK_METHOD1(IsFenceSyncFlushReceived, bool(uint64_t release)); | 117 MOCK_METHOD1(IsFenceSyncFlushReceived, bool(uint64_t release)); |
117 MOCK_METHOD1(IsFenceSyncReleased, bool(uint64_t release)); | 118 MOCK_METHOD1(IsFenceSyncReleased, bool(uint64_t release)); |
118 MOCK_METHOD2(SignalSyncToken, void(const SyncToken& sync_token, | 119 MOCK_METHOD2(SignalSyncToken, void(const SyncToken& sync_token, |
119 const base::Closure& callback)); | 120 const base::Closure& callback)); |
120 MOCK_METHOD1(WaitSyncTokenHint, void(const SyncToken&)); | 121 MOCK_METHOD1(WaitSyncTokenHint, void(const SyncToken&)); |
121 MOCK_METHOD1(CanWaitUnverifiedSyncToken, bool(const SyncToken&)); | 122 MOCK_METHOD1(CanWaitUnverifiedSyncToken, bool(const SyncToken&)); |
| 123 MOCK_METHOD1(AddLatencyInfo, void(const std::vector<ui::LatencyInfo>&)); |
122 | 124 |
123 private: | 125 private: |
124 DISALLOW_COPY_AND_ASSIGN(MockClientGpuControl); | 126 DISALLOW_COPY_AND_ASSIGN(MockClientGpuControl); |
125 }; | 127 }; |
126 | 128 |
127 } // namespace gpu | 129 } // namespace gpu |
128 | 130 |
129 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ | 131 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_TEST_HELPER_H_ |
130 | 132 |
OLD | NEW |