| 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 // Tests for the Command Buffer Helper. | 5 // Tests for the Command Buffer Helper. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/transfer_buffer.h" | 7 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "gpu/command_buffer/client/client_test_helper.h" | 10 #include "gpu/command_buffer/client/client_test_helper.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 if (transfer_buffer_->HaveBuffer()) { | 75 if (transfer_buffer_->HaveBuffer()) { |
| 76 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) | 76 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) |
| 77 .Times(1) | 77 .Times(1) |
| 78 .RetiresOnSaturation(); | 78 .RetiresOnSaturation(); |
| 79 } | 79 } |
| 80 // For command buffer. | 80 // For command buffer. |
| 81 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) | 81 EXPECT_CALL(*command_buffer(), DestroyTransferBuffer(_)) |
| 82 .Times(1) | 82 .Times(1) |
| 83 .RetiresOnSaturation(); | 83 .RetiresOnSaturation(); |
| 84 EXPECT_CALL(*command_buffer(), OnFlush()).Times(AtMost(1)); | 84 EXPECT_CALL(*command_buffer(), OnFlush()).Times(AtMost(1)); |
| 85 EXPECT_CALL(*command_buffer(), Flush(_)).Times(AtMost(1)); |
| 85 transfer_buffer_.reset(); | 86 transfer_buffer_.reset(); |
| 86 } | 87 } |
| 87 | 88 |
| 88 // GCC requires these declarations, but MSVC requires they not be present | 89 // GCC requires these declarations, but MSVC requires they not be present |
| 89 #ifndef _MSC_VER | 90 #ifndef _MSC_VER |
| 90 const int32 TransferBufferTest::kNumCommandEntries; | 91 const int32 TransferBufferTest::kNumCommandEntries; |
| 91 const int32 TransferBufferTest::kCommandBufferSizeBytes; | 92 const int32 TransferBufferTest::kCommandBufferSizeBytes; |
| 92 const unsigned int TransferBufferTest::kStartingOffset; | 93 const unsigned int TransferBufferTest::kStartingOffset; |
| 93 const unsigned int TransferBufferTest::kAlignment; | 94 const unsigned int TransferBufferTest::kAlignment; |
| 94 const size_t TransferBufferTest::kTransferBufferSize; | 95 const size_t TransferBufferTest::kTransferBufferSize; |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 477 |
| 477 // Check it's the default size. | 478 // Check it's the default size. |
| 478 EXPECT_EQ( | 479 EXPECT_EQ( |
| 479 kStartTransferBufferSize - kStartingOffset, | 480 kStartTransferBufferSize - kStartingOffset, |
| 480 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc()); | 481 transfer_buffer_->GetCurrentMaxAllocationWithoutRealloc()); |
| 481 } | 482 } |
| 482 | 483 |
| 483 } // namespace gpu | 484 } // namespace gpu |
| 484 | 485 |
| 485 | 486 |
| OLD | NEW |