Chromium Code Reviews| Index: base/trace_event/memory_allocator_dump_unittest.cc |
| diff --git a/base/trace_event/memory_allocator_dump_unittest.cc b/base/trace_event/memory_allocator_dump_unittest.cc |
| index 1bf9715917dedeb0181b8f2105cff6f17dd06d66..ebdc759a6e169120161dcf925214c19850baa9d7 100644 |
| --- a/base/trace_event/memory_allocator_dump_unittest.cc |
| +++ b/base/trace_event/memory_allocator_dump_unittest.cc |
| @@ -172,6 +172,17 @@ 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); |
| + dump->AddScalar(MemoryAllocatorDump::kNameSize, "foo", 3); |
|
Primiano Tucci (use gerrit)
2017/03/22 17:19:52
repeating the same scalar name multiple times is u
hjd
2017/03/22 19:24:20
Done.
|
| + 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) { |