Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 2041583003: [tracing] Introduce "allowed_dump_modes" for memory dump config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@background_config
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 .Times(5); 1141 .Times(5);
1142 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(IsBackgroundDump(), _)) 1142 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(IsBackgroundDump(), _))
1143 .WillOnce(Invoke([quit_closure](const MemoryDumpRequestArgs& args, 1143 .WillOnce(Invoke([quit_closure](const MemoryDumpRequestArgs& args,
1144 const MemoryDumpCallback& callback) { 1144 const MemoryDumpCallback& callback) {
1145 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure); 1145 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure);
1146 })); 1146 }));
1147 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(AnyNumber()); 1147 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(AnyNumber());
1148 1148
1149 EnableTracingWithTraceConfig( 1149 EnableTracingWithTraceConfig(
1150 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger()); 1150 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger());
1151
1152 // Only background mode dumps should be allowed with the trace config.
1153 last_callback_success_ = false;
1154 RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED,
1155 MemoryDumpLevelOfDetail::LIGHT);
1156 EXPECT_FALSE(last_callback_success_);
1157 last_callback_success_ = false;
1158 RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED,
1159 MemoryDumpLevelOfDetail::DETAILED);
1160 EXPECT_FALSE(last_callback_success_);
1161
1151 ASSERT_TRUE(IsPeriodicDumpingEnabled()); 1162 ASSERT_TRUE(IsPeriodicDumpingEnabled());
1152 run_loop.Run(); 1163 run_loop.Run();
1153 DisableTracing(); 1164 DisableTracing();
1154 } 1165 }
1155 1166
1156 } // namespace trace_event 1167 } // namespace trace_event
1157 } // namespace base 1168 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698