| 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 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "gpu/command_buffer/common/command_buffer_mock.h" | 7 #include "gpu/command_buffer/common/command_buffer_mock.h" |
| 8 #include "gpu/command_buffer/service/mocks.h" | 8 #include "gpu/command_buffer/service/mocks.h" |
| 9 #include "gpu/command_buffer/service/gpu_processor.h" | 9 #include "gpu/command_buffer/service/gpu_processor.h" |
| 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 MessageLoop::current()->RunAllPending(); | 68 MessageLoop::current()->RunAllPending(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 error::Error GetError() { | 71 error::Error GetError() { |
| 72 return command_buffer_->GetState().error; | 72 return command_buffer_->GetState().error; |
| 73 } | 73 } |
| 74 | 74 |
| 75 base::AtExitManager at_exit_manager; | 75 base::AtExitManager at_exit_manager; |
| 76 MessageLoop message_loop; | 76 MessageLoop message_loop; |
| 77 scoped_ptr<MockCommandBuffer> command_buffer_; | 77 scoped_ptr<MockCommandBuffer> command_buffer_; |
| 78 scoped_ptr<::base::SharedMemory> shared_memory_; | 78 scoped_ptr<base::SharedMemory> shared_memory_; |
| 79 Buffer shared_memory_buffer_; | 79 Buffer shared_memory_buffer_; |
| 80 int32* buffer_; | 80 int32* buffer_; |
| 81 gles2::MockGLES2Decoder* decoder_; | 81 gles2::MockGLES2Decoder* decoder_; |
| 82 CommandParser* parser_; | 82 CommandParser* parser_; |
| 83 scoped_ptr<AsyncAPIMock> async_api_; | 83 scoped_ptr<AsyncAPIMock> async_api_; |
| 84 scoped_refptr<GPUProcessor> processor_; | 84 scoped_refptr<GPUProcessor> processor_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 TEST_F(GPUProcessorTest, ProcessorDoesNothingIfRingBufferIsEmpty) { | 87 TEST_F(GPUProcessorTest, ProcessorDoesNothingIfRingBufferIsEmpty) { |
| 88 CommandBuffer::State state; | 88 CommandBuffer::State state; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 EXPECT_EQ(kRingBufferSize, processor_->GetSharedMemoryBuffer(7).size); | 247 EXPECT_EQ(kRingBufferSize, processor_->GetSharedMemoryBuffer(7).size); |
| 248 } | 248 } |
| 249 | 249 |
| 250 TEST_F(GPUProcessorTest, SetTokenForwardsToCommandBuffer) { | 250 TEST_F(GPUProcessorTest, SetTokenForwardsToCommandBuffer) { |
| 251 EXPECT_CALL(*command_buffer_, SetToken(7)); | 251 EXPECT_CALL(*command_buffer_, SetToken(7)); |
| 252 processor_->set_token(7); | 252 processor_->set_token(7); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace gpu | 255 } // namespace gpu |
| OLD | NEW |