Index: ppapi/shared_impl/media_stream_buffer_manager_unittest.cc |
diff --git a/ppapi/shared_impl/media_stream_buffer_manager_unittest.cc b/ppapi/shared_impl/media_stream_buffer_manager_unittest.cc |
index 090cb2a36d6718874493c6e5b5c9efbb6f53be65..7eb368337a22e43ec815610139ce5c94052bef1e 100644 |
--- a/ppapi/shared_impl/media_stream_buffer_manager_unittest.cc |
+++ b/ppapi/shared_impl/media_stream_buffer_manager_unittest.cc |
@@ -56,20 +56,24 @@ TEST(MediaStreamBufferManager, General) { |
EXPECT_EQ(kNumberOfBuffers, manager.number_of_buffers()); |
EXPECT_EQ(kBufferSize, manager.buffer_size()); |
+ EXPECT_EQ(kNumberOfBuffers, manager.BuffersAvailable()); |
// Test DequeueBuffer() and GetBufferPointer() |
for (int32_t i = 0; i < kNumberOfBuffers; ++i) { |
+ EXPECT_EQ(kNumberOfBuffers - i, manager.BuffersAvailable()); |
EXPECT_EQ(i, manager.DequeueBuffer()); |
EXPECT_EQ(reinterpret_cast<MediaStreamBuffer*>(memory + i * kBufferSize), |
manager.GetBufferPointer(i)); |
} |
+ EXPECT_EQ(0, manager.BuffersAvailable()); |
manager.EnqueueBuffer(0); |
manager.EnqueueBuffer(4); |
manager.EnqueueBuffer(3); |
manager.EnqueueBuffer(1); |
manager.EnqueueBuffer(2); |
EXPECT_EQ(5, delegate.new_buffer_enqueue_counter_); |
+ EXPECT_EQ(kNumberOfBuffers, manager.BuffersAvailable()); |
EXPECT_EQ(0, manager.DequeueBuffer()); |
EXPECT_EQ(4, manager.DequeueBuffer()); |
@@ -108,6 +112,7 @@ TEST(MediaStreamBufferManager, General) { |
EXPECT_EQ(kNumberOfBuffers, manager.number_of_buffers()); |
EXPECT_EQ(kBufferSize, manager.buffer_size()); |
+ EXPECT_EQ(0, manager.BuffersAvailable()); |
// Test DequeueBuffer() and GetBufferPointer() |
for (int32_t i = 0; i < kNumberOfBuffers; ++i) { |