| Index: gpu/command_buffer/client/ring_buffer_test.cc
|
| ===================================================================
|
| --- gpu/command_buffer/client/ring_buffer_test.cc (revision 45958)
|
| +++ gpu/command_buffer/client/ring_buffer_test.cc (working copy)
|
| @@ -161,6 +161,22 @@
|
| allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
|
| }
|
|
|
| +TEST_F(RingBufferTest, TestFreeBug) {
|
| + // The first and second allocations must not match.
|
| + const unsigned int kAlloc1 = 10;
|
| + const unsigned int kAlloc2 = 20;
|
| + RingBuffer::Offset offset = allocator_->Alloc(kAlloc1);
|
| + EXPECT_EQ(kBufferSize - kAlloc1, allocator_->GetLargestFreeSizeNoWaiting());
|
| + allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
|
| + offset = allocator_->Alloc(kAlloc2);
|
| + EXPECT_EQ(kBufferSize - kAlloc1 - kAlloc2,
|
| + allocator_->GetLargestFreeSizeNoWaiting());
|
| + allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
|
| + offset = allocator_->Alloc(kBufferSize);
|
| + EXPECT_EQ(0u, allocator_->GetLargestFreeSizeNoWaiting());
|
| + allocator_->FreePendingToken(offset, helper_.get()->InsertToken());
|
| +}
|
| +
|
| // Test fixture for RingBufferWrapper test - Creates a
|
| // RingBufferWrapper, using a CommandBufferHelper with a mock
|
| // AsyncAPIInterface for its interface (calling it directly, not through the
|
|
|