diff options
Diffstat (limited to 'base/trace_event/memory_allocator_dump_unittest.cc')
-rw-r--r-- | base/trace_event/memory_allocator_dump_unittest.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/trace_event/memory_allocator_dump_unittest.cc b/base/trace_event/memory_allocator_dump_unittest.cc index 1bf9715917..e1818f6eec 100644 --- a/base/trace_event/memory_allocator_dump_unittest.cc +++ b/base/trace_event/memory_allocator_dump_unittest.cc @@ -172,6 +172,16 @@ TEST(MemoryAllocatorDumpTest, DumpIntoProcessMemoryDump) { pmd.AsValueInto(traced_value.get()); } +TEST(MemoryAllocatorDumpTest, GetSize) { + MemoryDumpArgs dump_args = {MemoryDumpLevelOfDetail::DETAILED}; + ProcessMemoryDump pmd(new MemoryDumpSessionState, dump_args); + MemoryAllocatorDump* dump = pmd.CreateAllocatorDump("allocator_for_size"); + dump->AddScalar(MemoryAllocatorDump::kNameSize, + MemoryAllocatorDump::kUnitsBytes, 1); + dump->AddScalar("foo", MemoryAllocatorDump::kUnitsBytes, 2); + EXPECT_EQ(1u, dump->GetSize()); +} + // DEATH tests are not supported in Android / iOS. #if !defined(NDEBUG) && !defined(OS_ANDROID) && !defined(OS_IOS) TEST(MemoryAllocatorDumpTest, ForbidDuplicatesDeathTest) { |