OLD | NEW |
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 Loading... |
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 |
OLD | NEW |