Index: base/trace_event/memory_dump_manager_unittest.cc |
diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc |
index e117d0140730b3954a234e9042f6d68272d77b18..2f6d323e73abec8e78d6200b265fb91fe0ba122a 100644 |
--- a/base/trace_event/memory_dump_manager_unittest.cc |
+++ b/base/trace_event/memory_dump_manager_unittest.cc |
@@ -339,7 +339,8 @@ TEST_F(MemoryDumpManagerTest, SharedSessionState) { |
RegisterDumpProvider(&mdp2); |
EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); |
- const MemoryDumpSessionState* session_state = mdm_->session_state().get(); |
+ const MemoryDumpSessionState* session_state = |
+ mdm_->session_state_for_testing().get(); |
EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(2); |
EXPECT_CALL(mdp1, OnMemoryDump(_, _)) |
.Times(2) |
@@ -1150,6 +1151,17 @@ TEST_F(MemoryDumpManagerTest, TestBackgroundTracingSetup) { |
EnableTracingWithTraceConfig( |
TraceConfigMemoryTestUtil::GetTraceConfig_BackgroundTrigger( |
1 /* period_ms */)); |
+ |
+ // Only background mode dumps should be allowed with the trace config. |
+ last_callback_success_ = false; |
+ RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED, |
+ MemoryDumpLevelOfDetail::LIGHT); |
+ EXPECT_FALSE(last_callback_success_); |
+ last_callback_success_ = false; |
+ RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED, |
+ MemoryDumpLevelOfDetail::DETAILED); |
+ EXPECT_FALSE(last_callback_success_); |
+ |
ASSERT_TRUE(IsPeriodicDumpingEnabled()); |
run_loop.Run(); |
DisableTracing(); |