| 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 // This file contains the tests for the FencedAllocator class. | 5 // This file contains the tests for the FencedAllocator class. |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_nsautorelease_pool.h" | 9 #include "base/mac/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/client/fenced_allocator.h" | 11 #include "gpu/command_buffer/client/fenced_allocator.h" |
| 12 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 12 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 13 #include "gpu/command_buffer/service/mocks.h" | 13 #include "gpu/command_buffer/service/mocks.h" |
| 14 #include "gpu/command_buffer/service/command_buffer_service.h" | 14 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 15 #include "gpu/command_buffer/service/gpu_processor.h" | 15 #include "gpu/command_buffer/service/gpu_processor.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace gpu { | 18 namespace gpu { |
| 19 | 19 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 api_mock_->set_engine(gpu_processor_.get()); | 59 api_mock_->set_engine(gpu_processor_.get()); |
| 60 | 60 |
| 61 helper_.reset(new CommandBufferHelper(command_buffer_.get())); | 61 helper_.reset(new CommandBufferHelper(command_buffer_.get())); |
| 62 helper_->Initialize(kBufferSize); | 62 helper_->Initialize(kBufferSize); |
| 63 } | 63 } |
| 64 | 64 |
| 65 int32 GetToken() { | 65 int32 GetToken() { |
| 66 return command_buffer_->GetState().token; | 66 return command_buffer_->GetState().token; |
| 67 } | 67 } |
| 68 | 68 |
| 69 base::ScopedNSAutoreleasePool autorelease_pool_; | 69 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
| 70 MessageLoop message_loop_; | 70 MessageLoop message_loop_; |
| 71 scoped_ptr<AsyncAPIMock> api_mock_; | 71 scoped_ptr<AsyncAPIMock> api_mock_; |
| 72 scoped_ptr<CommandBufferService> command_buffer_; | 72 scoped_ptr<CommandBufferService> command_buffer_; |
| 73 scoped_ptr<GPUProcessor> gpu_processor_; | 73 scoped_ptr<GPUProcessor> gpu_processor_; |
| 74 CommandParser* parser_; | 74 CommandParser* parser_; |
| 75 scoped_ptr<CommandBufferHelper> helper_; | 75 scoped_ptr<CommandBufferHelper> helper_; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #ifndef _MSC_VER | 78 #ifndef _MSC_VER |
| 79 const unsigned int BaseFencedAllocatorTest::kBufferSize; | 79 const unsigned int BaseFencedAllocatorTest::kBufferSize; |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 EXPECT_LE(token, GetToken()); | 513 EXPECT_LE(token, GetToken()); |
| 514 | 514 |
| 515 // Free up everything. | 515 // Free up everything. |
| 516 for (unsigned int i = 0; i < kAllocCount; ++i) { | 516 for (unsigned int i = 0; i < kAllocCount; ++i) { |
| 517 allocator_->Free(pointers[i]); | 517 allocator_->Free(pointers[i]); |
| 518 EXPECT_TRUE(allocator_->CheckConsistency()); | 518 EXPECT_TRUE(allocator_->CheckConsistency()); |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace gpu | 522 } // namespace gpu |
| OLD | NEW |