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

Unified Diff: components/html_viewer/discardable_memory_allocator_unittest.cc

Issue 1181013010: Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit warning Created 5 years, 6 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
Index: components/html_viewer/discardable_memory_allocator_unittest.cc
diff --git a/components/html_viewer/discardable_memory_allocator_unittest.cc b/components/html_viewer/discardable_memory_allocator_unittest.cc
index cc73fb0cbbfb115d8cde3b543767967ffd9a24c5..95cea2950bafdd45c08303f83e6da6c295f46487 100644
--- a/components/html_viewer/discardable_memory_allocator_unittest.cc
+++ b/components/html_viewer/discardable_memory_allocator_unittest.cc
@@ -15,23 +15,16 @@ const size_t kAlmostOneMegabyte = 1023 * kOneKilobyte;
const size_t kOneMegabyte = 1024 * kOneKilobyte;
TEST(DiscardableMemoryAllocator, Basic) {
+ DiscardableMemoryAllocator allocator(kOneMegabyte);
scoped_ptr<base::DiscardableMemory> chunk;
-
- {
- DiscardableMemoryAllocator allocator(kOneMegabyte);
-
- // Make sure the chunk is locked when allocated. In debug mode, we will
- // dcheck.
- chunk = allocator.AllocateLockedDiscardableMemory(kOneKilobyte);
- chunk->Unlock();
-
- // Make sure we can lock a chunk.
- EXPECT_TRUE(chunk->Lock());
- chunk->Unlock();
- }
-
- // The chunk's backing should have disappeared with the allocator.
- EXPECT_FALSE(chunk->Lock());
+ // Make sure the chunk is locked when allocated. In debug mode, we will
+ // dcheck.
+ chunk = allocator.AllocateLockedDiscardableMemory(kOneKilobyte);
+ chunk->Unlock();
+
+ // Make sure we can lock a chunk.
+ EXPECT_TRUE(chunk->Lock());
+ chunk->Unlock();
}
TEST(DiscardableMemoryAllocator, DiscardChunks) {

Powered by Google App Engine
This is Rietveld 408576698