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

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

Issue 1186393004: gpu: Remove async texture uploads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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_c_lib_autogen.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 d5b3437fd5ac6f167bd2311066033056a78b72f4..94faf0ca917eb8cb7012a71570a1160f501aa6f5 100644
--- a/gpu/command_buffer/client/fenced_allocator_test.cc
+++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -80,11 +80,6 @@ class BaseFencedAllocatorTest : public testing::Test {
const unsigned int BaseFencedAllocatorTest::kBufferSize;
#endif
-namespace {
-void EmptyPoll() {
-}
-}
-
// Test fixture for FencedAllocator test - Creates a FencedAllocator, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
// it directly, not through the RPC mechanism), making sure Noops are ignored
@@ -93,9 +88,7 @@ class FencedAllocatorTest : public BaseFencedAllocatorTest {
protected:
void SetUp() override {
BaseFencedAllocatorTest::SetUp();
- allocator_.reset(new FencedAllocator(kBufferSize,
- helper_.get(),
- base::Bind(&EmptyPoll)));
+ allocator_.reset(new FencedAllocator(kBufferSize, helper_.get()));
}
void TearDown() override {
@@ -390,63 +383,6 @@ TEST_F(FencedAllocatorTest, TestGetLargestFreeOrPendingSize) {
EXPECT_EQ(kBufferSize, allocator_->GetLargestFreeSize());
}
-class FencedAllocatorPollTest : public BaseFencedAllocatorTest {
- public:
- static const unsigned int kAllocSize = 128;
-
- MOCK_METHOD0(MockedPoll, void());
-
- protected:
- virtual void TearDown() {
- // If the GpuScheduler posts any tasks, this forces them to run.
- base::MessageLoop::current()->RunUntilIdle();
-
- BaseFencedAllocatorTest::TearDown();
- }
-};
-
-TEST_F(FencedAllocatorPollTest, TestPoll) {
- scoped_ptr<FencedAllocator> allocator(
- new FencedAllocator(kBufferSize,
- helper_.get(),
- base::Bind(&FencedAllocatorPollTest::MockedPoll,
- base::Unretained(this))));
-
- FencedAllocator::Offset mem1 = allocator->Alloc(kAllocSize);
- FencedAllocator::Offset mem2 = allocator->Alloc(kAllocSize);
- EXPECT_NE(mem1, FencedAllocator::kInvalidOffset);
- EXPECT_NE(mem2, FencedAllocator::kInvalidOffset);
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 2);
-
- // Check that no-op Poll doesn't affect the state.
- EXPECT_CALL(*this, MockedPoll()).RetiresOnSaturation();
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 2);
-
- // Check that freeing in Poll works.
- base::Closure free_mem1_closure =
- base::Bind(&FencedAllocator::Free,
- base::Unretained(allocator.get()),
- mem1);
- EXPECT_CALL(*this, MockedPoll())
- .WillOnce(InvokeWithoutArgs(&free_mem1_closure, &base::Closure::Run))
- .RetiresOnSaturation();
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), kAllocSize * 1);
-
- // Check that freeing still works.
- EXPECT_CALL(*this, MockedPoll()).RetiresOnSaturation();
- allocator->Free(mem2);
- allocator->FreeUnused();
- EXPECT_TRUE(allocator->CheckConsistency());
- EXPECT_EQ(allocator->bytes_in_use(), 0u);
-
- allocator.reset();
-}
-
// Test fixture for FencedAllocatorWrapper test - Creates a
// FencedAllocatorWrapper, using a CommandBufferHelper with a mock
// AsyncAPIInterface for its interface (calling it directly, not through the
@@ -464,7 +400,6 @@ class FencedAllocatorWrapperTest : public BaseFencedAllocatorTest {
kBufferSize, kAllocAlignment)));
allocator_.reset(new FencedAllocatorWrapper(kBufferSize,
helper_.get(),
- base::Bind(&EmptyPoll),
buffer_.get()));
}
« no previous file with comments | « gpu/command_buffer/client/fenced_allocator.cc ('k') | gpu/command_buffer/client/gles2_c_lib_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698