OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "base/trace_event/memory_allocator_dump.h" | 5 #include "base/trace_event/memory_allocator_dump.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/memory_allocator_dump_guid.h" | 9 #include "base/trace_event/memory_allocator_dump_guid.h" |
10 #include "base/trace_event/memory_dump_provider.h" | 10 #include "base/trace_event/memory_dump_provider.h" |
11 #include "base/trace_event/memory_dump_session_state.h" | 11 #include "base/trace_event/memory_dump_session_state.h" |
12 #include "base/trace_event/process_memory_dump.h" | 12 #include "base/trace_event/process_memory_dump.h" |
13 #include "base/trace_event/trace_event_argument.h" | 13 #include "base/trace_event/trace_event_argument.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/googletest/include/gtest/gtest.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 namespace trace_event { | 18 namespace trace_event { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class FakeMemoryAllocatorDumpProvider : public MemoryDumpProvider { | 22 class FakeMemoryAllocatorDumpProvider : public MemoryDumpProvider { |
23 public: | 23 public: |
24 bool OnMemoryDump(const MemoryDumpArgs& args, | 24 bool OnMemoryDump(const MemoryDumpArgs& args, |
25 ProcessMemoryDump* pmd) override { | 25 ProcessMemoryDump* pmd) override { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 pmd.CreateAllocatorDump("foo_allocator"); | 176 pmd.CreateAllocatorDump("foo_allocator"); |
177 pmd.CreateAllocatorDump("bar_allocator/heap"); | 177 pmd.CreateAllocatorDump("bar_allocator/heap"); |
178 ASSERT_DEATH(pmd.CreateAllocatorDump("foo_allocator"), ""); | 178 ASSERT_DEATH(pmd.CreateAllocatorDump("foo_allocator"), ""); |
179 ASSERT_DEATH(pmd.CreateAllocatorDump("bar_allocator/heap"), ""); | 179 ASSERT_DEATH(pmd.CreateAllocatorDump("bar_allocator/heap"), ""); |
180 ASSERT_DEATH(pmd.CreateAllocatorDump(""), ""); | 180 ASSERT_DEATH(pmd.CreateAllocatorDump(""), ""); |
181 } | 181 } |
182 #endif | 182 #endif |
183 | 183 |
184 } // namespace trace_event | 184 } // namespace trace_event |
185 } // namespace base | 185 } // namespace base |
OLD | NEW |