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 de19ea25b863b269b6659d74da2b9f1c96cfd1a5..135c57292bd09c5044c0d3e8319323ca46b1c453 100644 |
| --- a/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| +++ b/base/trace_event/heap_profiler_allocation_context_tracker_unittest.cc |
| @@ -27,6 +27,19 @@ const char kEclair[] = "Eclair"; |
| const char kFroyo[] = "Froyo"; |
| const char kGingerbread[] = "Gingerbread"; |
| +const char kFilteringTraceConfig[] = |
| + "{" |
| + " \"event_filters\": [" |
| + " {" |
| + " \"excluded_categories\": []," |
| + " \"filter_args\": {}," |
| + " \"filter_predicate\": \"heap_profiler_predicate\"," |
| + " \"included_categories\": [\"*\"]" |
| + " }" |
| + " ]," |
| + " \"included_categories\": [\"disabled-by-default-memory-infra\"]" |
|
Primiano Tucci (use gerrit)
2016/10/12 17:50:17
should this be: -*, disabled-....
otherwise all th
ssid
2016/10/12 19:04:43
Actually I think the SetEnabled must not have RECO
|
| + "}"; |
| + |
| // Asserts that the fixed-size array |expected_backtrace| matches the backtrace |
| // in |AllocationContextTracker::GetContextSnapshot|. |
| template <size_t N> |
| @@ -68,15 +81,17 @@ class AllocationContextTrackerTest : public testing::Test { |
| AllocationContextTracker::CaptureMode::PSEUDO_STACK); |
| // Enabling memory-infra category sets default memory dump config which |
| // includes filters for capturing pseudo stack. |
| - TraceConfig config(MemoryDumpManager::kTraceCategory, ""); |
| - TraceLog::GetInstance()->SetEnabled(config, TraceLog::RECORDING_MODE); |
| + TraceConfig config(kFilteringTraceConfig); |
| + TraceLog::GetInstance()->SetEnabled( |
| + config, TraceLog::RECORDING_MODE | TraceLog::FILTERING_MODE); |
| AllocationContextTracker::SetCurrentThreadName(kThreadName); |
| } |
| void TearDown() override { |
| AllocationContextTracker::SetCaptureMode( |
| AllocationContextTracker::CaptureMode::DISABLED); |
| - TraceLog::GetInstance()->SetDisabled(); |
| + TraceLog::GetInstance()->SetDisabled(TraceLog::RECORDING_MODE | |
| + TraceLog::FILTERING_MODE); |
| } |
| }; |