Index: base/trace_event/memory_dump_manager.cc |
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc |
index f6e0239a215393866b2537800aab4931cfa77153..1c3c581d8ebece634081ce613e1057a0d0d70111 100644 |
--- a/base/trace_event/memory_dump_manager.cc |
+++ b/base/trace_event/memory_dump_manager.cc |
@@ -97,7 +97,8 @@ MemoryDumpManager::MemoryDumpManager() |
memory_tracing_enabled_(0), |
tracing_process_id_(kInvalidTracingProcessId), |
system_allocator_pool_name_(nullptr), |
- skip_core_dumpers_auto_registration_for_testing_(false) { |
+ skip_core_dumpers_auto_registration_for_testing_(false), |
+ disable_periodic_dumps_for_testing_(false) { |
g_next_guid.GetNext(); // Make sure that first guid is not zero. |
} |
@@ -423,9 +424,11 @@ void MemoryDumpManager::OnTraceLogEnabled() { |
// TODO(primiano): This is a temporary hack to disable periodic memory dumps |
// when running memory benchmarks until they can be enabled/disabled in |
// base::trace_event::TraceConfig. See https://goo.gl/5Hj3o0. |
+ // The same mechanism should be used to disable periodic dumps in tests. |
if (delegate_->IsCoordinatorProcess() && |
!CommandLine::ForCurrentProcess()->HasSwitch( |
- "enable-memory-benchmarking")) { |
+ "enable-memory-benchmarking") && |
+ !disable_periodic_dumps_for_testing_) { |
g_periodic_dumps_count = 0; |
periodic_dump_timer_.Start(FROM_HERE, |
TimeDelta::FromMilliseconds(kDumpIntervalMs), |