Chromium Code Reviews| Index: base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| diff --git a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| index 05c60c722c317cca7bf6e52453a5faba1d7b1903..2463f1a7366b86be9f5d21cd3fb2465ca1fd1cad 100644 |
| --- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| +++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/pending_task.h" |
| #include "base/trace_event/heap_profiler_allocation_context.h" |
| #include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
| +#include "base/trace_event/heap_profiler_scoped_ignore.h" |
| #include "base/trace_event/trace_event.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -278,5 +279,17 @@ TEST_F(AllocationContextTrackerTest, TrackTaskContext) { |
| ASSERT_FALSE(ctx.type_name); |
| } |
| +TEST_F(AllocationContextTrackerTest, IgnoreAllocationTest) { |
| + TRACE_EVENT0("Testing", kCupcake); |
| + TRACE_EVENT0("Testing", kDonut); |
| + HEAP_PROFILER_SCOPED_IGNORE; |
| + AllocationContext ctx1 = |
| + AllocationContextTracker::GetInstanceForCurrentThread() |
| + ->GetContextSnapshot(); |
| + const StringPiece kTracingOverhead("tracing_overhead"); |
| + ASSERT_EQ(kTracingOverhead, ctx1.backtrace.frames[0]); |
| + ASSERT_FALSE(ctx1.backtrace.frames[1]); |
|
Primiano Tucci (use gerrit)
2016/04/21 19:47:32
this is not guaranteed to be nullptr anymore.
This
ssid
2016/04/22 04:57:12
Done.
|
| +} |
| + |
| } // namespace trace_event |
| } // namespace base |