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

Side by Side Diff: gpu/command_buffer/client/buffer_tracker_unittest.cc

Issue 23130004: Enforce a memory limit on MappedMemoryManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another namespace error Created 7 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 unified diff | Download patch
OLDNEW
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 BufferTracker. 5 // Tests for the BufferTracker.
6 6
7 #include "gpu/command_buffer/client/buffer_tracker.h" 7 #include "gpu/command_buffer/client/buffer_tracker.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class BufferTrackerTest : public testing::Test { 44 class BufferTrackerTest : public testing::Test {
45 protected: 45 protected:
46 static const int32 kNumCommandEntries = 400; 46 static const int32 kNumCommandEntries = 400;
47 static const int32 kCommandBufferSizeBytes = 47 static const int32 kCommandBufferSizeBytes =
48 kNumCommandEntries * sizeof(CommandBufferEntry); 48 kNumCommandEntries * sizeof(CommandBufferEntry);
49 49
50 virtual void SetUp() { 50 virtual void SetUp() {
51 command_buffer_.reset(new MockClientCommandBufferImpl()); 51 command_buffer_.reset(new MockClientCommandBufferImpl());
52 helper_.reset(new GLES2CmdHelper(command_buffer_.get())); 52 helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
53 helper_->Initialize(kCommandBufferSizeBytes); 53 helper_->Initialize(kCommandBufferSizeBytes);
54 mapped_memory_.reset(new MappedMemoryManager(helper_.get())); 54 mapped_memory_.reset(new MappedMemoryManager(
55 helper_.get(), MappedMemoryManager::kNoLimit));
55 buffer_tracker_.reset(new BufferTracker(mapped_memory_.get())); 56 buffer_tracker_.reset(new BufferTracker(mapped_memory_.get()));
56 } 57 }
57 58
58 virtual void TearDown() { 59 virtual void TearDown() {
59 buffer_tracker_.reset(); 60 buffer_tracker_.reset();
60 mapped_memory_.reset(); 61 mapped_memory_.reset();
61 helper_.reset(); 62 helper_.reset();
62 command_buffer_.reset(); 63 command_buffer_.reset();
63 } 64 }
64 65
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Check mapped memory address. 121 // Check mapped memory address.
121 EXPECT_TRUE(buffer->address() == NULL); 122 EXPECT_TRUE(buffer->address() == NULL);
122 // Check no shared memory was allocated. 123 // Check no shared memory was allocated.
123 EXPECT_EQ(0lu, mapped_memory_->num_chunks()); 124 EXPECT_EQ(0lu, mapped_memory_->num_chunks());
124 // Check we can delete the buffer. 125 // Check we can delete the buffer.
125 buffer_tracker_->RemoveBuffer(kId); 126 buffer_tracker_->RemoveBuffer(kId);
126 } 127 }
127 128
128 } // namespace gles2 129 } // namespace gles2
129 } // namespace gpu 130 } // namespace gpu
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | gpu/command_buffer/client/fenced_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698