| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/aligned_memory.h" | 9 #include "base/memory/aligned_memory.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 helper_->Initialize(kBufferSize); | 70 helper_->Initialize(kBufferSize); |
| 71 } | 71 } |
| 72 | 72 |
| 73 int32 GetToken() { | 73 int32 GetToken() { |
| 74 return command_buffer_->GetLastState().token; | 74 return command_buffer_->GetLastState().token; |
| 75 } | 75 } |
| 76 | 76 |
| 77 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
| 78 base::mac::ScopedNSAutoreleasePool autorelease_pool_; | 78 base::mac::ScopedNSAutoreleasePool autorelease_pool_; |
| 79 #endif | 79 #endif |
| 80 #if !defined(USE_OZONE) |
| 80 base::MessageLoop message_loop_; | 81 base::MessageLoop message_loop_; |
| 82 #endif |
| 81 scoped_ptr<AsyncAPIMock> api_mock_; | 83 scoped_ptr<AsyncAPIMock> api_mock_; |
| 82 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; | 84 scoped_ptr<TransferBufferManagerInterface> transfer_buffer_manager_; |
| 83 scoped_ptr<CommandBufferService> command_buffer_; | 85 scoped_ptr<CommandBufferService> command_buffer_; |
| 84 scoped_ptr<GpuScheduler> gpu_scheduler_; | 86 scoped_ptr<GpuScheduler> gpu_scheduler_; |
| 85 scoped_ptr<CommandBufferHelper> helper_; | 87 scoped_ptr<CommandBufferHelper> helper_; |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 #ifndef _MSC_VER | 90 #ifndef _MSC_VER |
| 89 const unsigned int BaseFencedAllocatorTest::kBufferSize; | 91 const unsigned int BaseFencedAllocatorTest::kBufferSize; |
| 90 #endif | 92 #endif |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 EXPECT_LE(token, GetToken()); | 638 EXPECT_LE(token, GetToken()); |
| 637 | 639 |
| 638 // Free up everything. | 640 // Free up everything. |
| 639 for (unsigned int i = 0; i < kAllocCount; ++i) { | 641 for (unsigned int i = 0; i < kAllocCount; ++i) { |
| 640 allocator_->Free(pointers[i]); | 642 allocator_->Free(pointers[i]); |
| 641 EXPECT_TRUE(allocator_->CheckConsistency()); | 643 EXPECT_TRUE(allocator_->CheckConsistency()); |
| 642 } | 644 } |
| 643 } | 645 } |
| 644 | 646 |
| 645 } // namespace gpu | 647 } // namespace gpu |
| OLD | NEW |