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

Unified Diff: components/html_viewer/discardable_memory_allocator_unittest.cc

Issue 1189833005: Revert of Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « components/html_viewer/discardable_memory_allocator.cc ('k') | components/html_viewer/html_document.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 95cea2950bafdd45c08303f83e6da6c295f46487..cc73fb0cbbfb115d8cde3b543767967ffd9a24c5 100644
--- a/components/html_viewer/discardable_memory_allocator_unittest.cc
+++ b/components/html_viewer/discardable_memory_allocator_unittest.cc
@@ -15,16 +15,23 @@
const size_t kOneMegabyte = 1024 * kOneKilobyte;
TEST(DiscardableMemoryAllocator, Basic) {
- DiscardableMemoryAllocator allocator(kOneMegabyte);
scoped_ptr<base::DiscardableMemory> chunk;
- // 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();
+ {
+ 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());
}
TEST(DiscardableMemoryAllocator, DiscardChunks) {
« no previous file with comments | « components/html_viewer/discardable_memory_allocator.cc ('k') | components/html_viewer/html_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698