Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: gpu/command_buffer/client/fenced_allocator_test.cc

Issue 8369010: Add GLES2Implemention::FreeUnusedSharedMemory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/fenced_allocator.cc ('k') | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/fenced_allocator_test.cc
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc
index 8f2f609deba12998022b0641722b5aed9c34fc91..aae3fd4cef54cedc7c7890fceb8b675ecdf61489 100644
--- a/gpu/command_buffer/client/fenced_allocator_test.cc
+++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -105,14 +105,17 @@ class FencedAllocatorTest : public BaseFencedAllocatorTest {
// Checks basic alloc and free.
TEST_F(FencedAllocatorTest, TestBasic) {
allocator_->CheckConsistency();
+ EXPECT_FALSE(allocator_->InUse());
const unsigned int kSize = 16;
FencedAllocator::Offset offset = allocator_->Alloc(kSize);
+ EXPECT_TRUE(allocator_->InUse());
EXPECT_NE(FencedAllocator::kInvalidOffset, offset);
EXPECT_GE(kBufferSize, offset+kSize);
EXPECT_TRUE(allocator_->CheckConsistency());
allocator_->Free(offset);
+ EXPECT_FALSE(allocator_->InUse());
EXPECT_TRUE(allocator_->CheckConsistency());
}
@@ -222,6 +225,7 @@ TEST_F(FencedAllocatorTest, FreeUnused) {
EXPECT_GE(kBufferSize, offsets[i]+kSize);
EXPECT_TRUE(allocator_->CheckConsistency());
}
+ EXPECT_TRUE(allocator_->InUse());
// No memory should be available.
EXPECT_EQ(0u, allocator_->GetLargestFreeSize());
@@ -258,12 +262,14 @@ TEST_F(FencedAllocatorTest, FreeUnused) {
// Check that the new largest free size takes into account the unused blocks.
EXPECT_EQ(kSize * 3, allocator_->GetLargestFreeSize());
+ EXPECT_TRUE(allocator_->InUse());
// Free up everything.
for (unsigned int i = 3; i < kAllocCount; ++i) {
allocator_->Free(offsets[i]);
EXPECT_TRUE(allocator_->CheckConsistency());
}
+ EXPECT_FALSE(allocator_->InUse());
}
// Tests GetLargestFreeSize
« no previous file with comments | « gpu/command_buffer/client/fenced_allocator.cc ('k') | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698