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

Unified Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 2845633002: memory-infra: Remove is_enabled_ from MDM (Closed)
Patch Set: address comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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 9d2d4394235dab720fc67960faccac1cdec5dd36..48f88fcbfa27525d8e46065e23ef0708eec72987 100644
--- a/base/trace_event/memory_dump_manager_unittest.cc
+++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -1030,44 +1030,6 @@ TEST_F(MemoryDumpManagerTest, TraceConfigExpectationsWhenIsCoordinator) {
DisableTracing();
}
-// Tests against race conditions that can happen if tracing is disabled before
-// the CreateProcessDump() call. Real-world regression: crbug.com/580295 .
-TEST_F(MemoryDumpManagerTest, DisableTracingRightBeforeStartOfDump) {
- base::WaitableEvent tracing_disabled_event(
- WaitableEvent::ResetPolicy::AUTOMATIC,
- WaitableEvent::InitialState::NOT_SIGNALED);
- InitializeMemoryDumpManager(false /* is_coordinator */);
-
- std::unique_ptr<Thread> mdp_thread(new Thread("test thread"));
- mdp_thread->Start();
-
- // Create both same-thread MDP and another MDP with dedicated thread
- MockMemoryDumpProvider mdp1;
- RegisterDumpProvider(&mdp1, nullptr);
- MockMemoryDumpProvider mdp2;
- RegisterDumpProvider(&mdp2, mdp_thread->task_runner(), kDefaultOptions);
- EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory);
-
- EXPECT_CALL(global_dump_handler_, RequestGlobalMemoryDump(_, _))
- .WillOnce(Invoke([this](const MemoryDumpRequestArgs& args,
- const GlobalMemoryDumpCallback& callback) {
- DisableTracing();
- ProcessMemoryDumpCallback process_callback =
- Bind(&ProcessDumpCallbackAdapter, callback);
- mdm_->CreateProcessDump(args, process_callback);
- }));
-
- // If tracing is disabled for current session CreateProcessDump() should NOT
- // request dumps from providers. Real-world regression: crbug.com/600570 .
- EXPECT_CALL(mdp1, OnMemoryDump(_, _)).Times(0);
- EXPECT_CALL(mdp2, OnMemoryDump(_, _)).Times(0);
-
- last_callback_success_ = true;
- RequestGlobalDumpAndWait(MemoryDumpType::EXPLICITLY_TRIGGERED,
- MemoryDumpLevelOfDetail::DETAILED);
- EXPECT_FALSE(last_callback_success_);
-}
-
TEST_F(MemoryDumpManagerTest, DumpOnBehalfOfOtherProcess) {
using trace_analyzer::Query;
« base/trace_event/memory_dump_manager.cc ('K') | « base/trace_event/memory_dump_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698