OLD | NEW |
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 // Tests for the Command Buffer Helper. | 5 // Tests for the Command Buffer Helper. |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/mac/scoped_nsautorelease_pool.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "base/scoped_nsautorelease_pool.h" | |
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
11 #include "gpu/command_buffer/service/mocks.h" | 11 #include "gpu/command_buffer/service/mocks.h" |
12 #include "gpu/command_buffer/service/command_buffer_service.h" | 12 #include "gpu/command_buffer/service/command_buffer_service.h" |
13 #include "gpu/command_buffer/service/gpu_processor.h" | 13 #include "gpu/command_buffer/service/gpu_processor.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace gpu { | 16 namespace gpu { |
17 | 17 |
18 using testing::Return; | 18 using testing::Return; |
19 using testing::Mock; | 19 using testing::Mock; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 int32 GetPutOffset() { | 145 int32 GetPutOffset() { |
146 return command_buffer_->GetState().put_offset; | 146 return command_buffer_->GetState().put_offset; |
147 } | 147 } |
148 | 148 |
149 error::Error GetError() { | 149 error::Error GetError() { |
150 return command_buffer_->GetState().error; | 150 return command_buffer_->GetState().error; |
151 } | 151 } |
152 | 152 |
153 CommandBufferOffset get_helper_put() { return helper_->put_; } | 153 CommandBufferOffset get_helper_put() { return helper_->put_; } |
154 | 154 |
155 base::ScopedNSAutoreleasePool autorelease_pool_; | 155 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
156 MessageLoop message_loop_; | 156 MessageLoop message_loop_; |
157 scoped_ptr<AsyncAPIMock> api_mock_; | 157 scoped_ptr<AsyncAPIMock> api_mock_; |
158 scoped_ptr<CommandBufferService> command_buffer_; | 158 scoped_ptr<CommandBufferService> command_buffer_; |
159 scoped_ptr<GPUProcessor> gpu_processor_; | 159 scoped_ptr<GPUProcessor> gpu_processor_; |
160 CommandParser* parser_; | 160 CommandParser* parser_; |
161 scoped_ptr<CommandBufferHelper> helper_; | 161 scoped_ptr<CommandBufferHelper> helper_; |
162 Sequence sequence_; | 162 Sequence sequence_; |
163 scoped_ptr<DoJumpCommand> do_jump_command_; | 163 scoped_ptr<DoJumpCommand> do_jump_command_; |
164 }; | 164 }; |
165 | 165 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 helper_->Finish(); | 301 helper_->Finish(); |
302 | 302 |
303 // Check that the commands did happen. | 303 // Check that the commands did happen. |
304 Mock::VerifyAndClearExpectations(api_mock_.get()); | 304 Mock::VerifyAndClearExpectations(api_mock_.get()); |
305 | 305 |
306 // Check the error status. | 306 // Check the error status. |
307 EXPECT_EQ(error::kNoError, GetError()); | 307 EXPECT_EQ(error::kNoError, GetError()); |
308 } | 308 } |
309 | 309 |
310 } // namespace gpu | 310 } // namespace gpu |
OLD | NEW |