OLD | NEW |
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 #include "gpu/command_buffer/service/command_executor.h" | 5 #include "gpu/command_buffer/service/command_executor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/test/scoped_task_environment.h" | 13 #include "base/test/scoped_task_environment.h" |
14 #include "gpu/command_buffer/common/command_buffer_mock.h" | 14 #include "gpu/command_buffer/common/command_buffer_mock.h" |
15 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 15 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
16 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 16 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
17 #include "gpu/command_buffer/service/mocks.h" | 17 #include "gpu/command_buffer/service/mocks.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 using testing::_; | 21 using testing::_; |
22 using testing::DoAll; | 22 using testing::DoAll; |
23 using testing::Invoke; | 23 using testing::Invoke; |
24 using testing::NiceMock; | 24 using testing::NiceMock; |
25 using testing::Return; | 25 using testing::Return; |
26 using testing::SetArgumentPointee; | 26 using testing::SetArgPointee; |
27 using testing::StrictMock; | 27 using testing::StrictMock; |
28 | 28 |
29 namespace gpu { | 29 namespace gpu { |
30 | 30 |
31 const size_t kRingBufferSize = 1024; | 31 const size_t kRingBufferSize = 1024; |
32 | 32 |
33 class CommandExecutorTest : public testing::Test { | 33 class CommandExecutorTest : public testing::Test { |
34 protected: | 34 protected: |
35 static const int32_t kTransferBufferId = 123; | 35 static const int32_t kTransferBufferId = 123; |
36 | 36 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 EXPECT_EQ(kRingBufferSize, executor_->GetSharedMemoryBuffer(7)->size()); | 200 EXPECT_EQ(kRingBufferSize, executor_->GetSharedMemoryBuffer(7)->size()); |
201 } | 201 } |
202 | 202 |
203 TEST_F(CommandExecutorTest, SetTokenForwardsToCommandBuffer) { | 203 TEST_F(CommandExecutorTest, SetTokenForwardsToCommandBuffer) { |
204 EXPECT_CALL(*command_buffer_, SetToken(7)); | 204 EXPECT_CALL(*command_buffer_, SetToken(7)); |
205 executor_->set_token(7); | 205 executor_->set_token(7); |
206 } | 206 } |
207 | 207 |
208 } // namespace gpu | 208 } // namespace gpu |
OLD | NEW |