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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "gpu/command_buffer/common/command_buffer_mock.h" | 6 #include "gpu/command_buffer/common/command_buffer_mock.h" |
7 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 7 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 8 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
9 #include "gpu/command_buffer/service/gpu_scheduler.h" | 9 #include "gpu/command_buffer/service/gpu_scheduler.h" |
10 #include "gpu/command_buffer/service/mocks.h" | 10 #include "gpu/command_buffer/service/mocks.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 base::MessageLoop::current()->RunUntilIdle(); | 68 base::MessageLoop::current()->RunUntilIdle(); |
69 } | 69 } |
70 | 70 |
71 error::Error GetError() { | 71 error::Error GetError() { |
72 return command_buffer_->GetLastState().error; | 72 return command_buffer_->GetLastState().error; |
73 } | 73 } |
74 | 74 |
75 #if defined(OS_MACOSX) | 75 #if defined(OS_MACOSX) |
76 base::mac::ScopedNSAutoreleasePool autorelease_pool_; | 76 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
77 #endif | 77 #endif |
| 78 #if !defined(USE_OZONE) |
78 base::MessageLoop message_loop; | 79 base::MessageLoop message_loop; |
| 80 #endif |
79 scoped_ptr<MockCommandBuffer> command_buffer_; | 81 scoped_ptr<MockCommandBuffer> command_buffer_; |
80 scoped_refptr<Buffer> shared_memory_buffer_; | 82 scoped_refptr<Buffer> shared_memory_buffer_; |
81 int32* buffer_; | 83 int32* buffer_; |
82 scoped_ptr<gles2::MockGLES2Decoder> decoder_; | 84 scoped_ptr<gles2::MockGLES2Decoder> decoder_; |
83 scoped_ptr<GpuScheduler> scheduler_; | 85 scoped_ptr<GpuScheduler> scheduler_; |
84 }; | 86 }; |
85 | 87 |
86 TEST_F(GpuSchedulerTest, SchedulerDoesNothingIfRingBufferIsEmpty) { | 88 TEST_F(GpuSchedulerTest, SchedulerDoesNothingIfRingBufferIsEmpty) { |
87 CommandBuffer::State state; | 89 CommandBuffer::State state; |
88 | 90 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 216 |
215 EXPECT_EQ(kRingBufferSize, scheduler_->GetSharedMemoryBuffer(7)->size()); | 217 EXPECT_EQ(kRingBufferSize, scheduler_->GetSharedMemoryBuffer(7)->size()); |
216 } | 218 } |
217 | 219 |
218 TEST_F(GpuSchedulerTest, SetTokenForwardsToCommandBuffer) { | 220 TEST_F(GpuSchedulerTest, SetTokenForwardsToCommandBuffer) { |
219 EXPECT_CALL(*command_buffer_, SetToken(7)); | 221 EXPECT_CALL(*command_buffer_, SetToken(7)); |
220 scheduler_->set_token(7); | 222 scheduler_->set_token(7); |
221 } | 223 } |
222 | 224 |
223 } // namespace gpu | 225 } // namespace gpu |
OLD | NEW |