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

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: rebase on 2049143002 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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 .Times(5); 1142 .Times(5);
1143 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(IsBackgroundDump(), _)) 1143 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(IsBackgroundDump(), _))
1144 .WillOnce(Invoke([quit_closure](const MemoryDumpRequestArgs& args, 1144 .WillOnce(Invoke([quit_closure](const MemoryDumpRequestArgs& args,
1145 const MemoryDumpCallback& callback) { 1145 const MemoryDumpCallback& callback) {
1146 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure); 1146 ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure);
1147 })); 1147 }));
1148 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(AnyNumber()); 1148 EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(AnyNumber());
1149 1149
1150 EnableTracingWithTraceConfig( 1150 EnableTracingWithTraceConfig(
1151 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger()); 1151 TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger());
1152
1153 // Only background mode dumps should be allowed with the trace config.
1154 last_callback_success_ = false;
1155 RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED,
1156 MemoryDumpLevelOfDetail::LIGHT);
1157 EXPECT_FALSE(last_callback_success_);
1158 last_callback_success_ = false;
1159 RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED,
1160 MemoryDumpLevelOfDetail::DETAILED);
1161 EXPECT_FALSE(last_callback_success_);
1162
1152 ASSERT_TRUE(IsPeriodicDumpingEnabled()); 1163 ASSERT_TRUE(IsPeriodicDumpingEnabled());
1153 run_loop.Run(); 1164 run_loop.Run();
1154 DisableTracing(); 1165 DisableTracing();
1155 } 1166 }
1156 1167
1157 } // namespace trace_event 1168 } // namespace trace_event
1158 } // namespace base 1169 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698