| 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 "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 710 |
| 711 EnableTracingWithTraceConfig( | 711 EnableTracingWithTraceConfig( |
| 712 TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers( | 712 TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers( |
| 713 kLightDumpPeriodMs, kHeavyDumpPeriodMs)); | 713 kLightDumpPeriodMs, kHeavyDumpPeriodMs)); |
| 714 run_loop.Run(); | 714 run_loop.Run(); |
| 715 DisableTracing(); | 715 DisableTracing(); |
| 716 } | 716 } |
| 717 | 717 |
| 718 // Tests against race conditions that might arise when disabling tracing in the | 718 // Tests against race conditions that might arise when disabling tracing in the |
| 719 // middle of a global memory dump. | 719 // middle of a global memory dump. |
| 720 // TODO(ssid): Enable this test once crbug.com/555584 is fixed. | 720 TEST_F(MemoryDumpManagerTest, DisableTracingWhileDumping) { |
| 721 TEST_F(MemoryDumpManagerTest, DISABLED_DisableTracingWhileDumping) { | |
| 722 base::WaitableEvent tracing_disabled_event(false, false); | 721 base::WaitableEvent tracing_disabled_event(false, false); |
| 723 InitializeMemoryDumpManager(false /* is_coordinator */); | 722 InitializeMemoryDumpManager(false /* is_coordinator */); |
| 724 | 723 |
| 725 // Register a bound dump provider. | 724 // Register a bound dump provider. |
| 726 scoped_ptr<Thread> mdp_thread(new Thread("test thread")); | 725 scoped_ptr<Thread> mdp_thread(new Thread("test thread")); |
| 727 mdp_thread->Start(); | 726 mdp_thread->Start(); |
| 728 MockMemoryDumpProvider mdp_with_affinity; | 727 MockMemoryDumpProvider mdp_with_affinity; |
| 729 RegisterDumpProvider(&mdp_with_affinity, mdp_thread->task_runner(), | 728 RegisterDumpProvider(&mdp_with_affinity, mdp_thread->task_runner(), |
| 730 kDefaultOptions); | 729 kDefaultOptions); |
| 731 | 730 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(123))); | 818 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(123))); |
| 820 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(456))); | 819 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(456))); |
| 821 ASSERT_EQ(1u, trace_analyzer::CountMatches( | 820 ASSERT_EQ(1u, trace_analyzer::CountMatches( |
| 822 events, Query::EventPidIs(GetCurrentProcId()))); | 821 events, Query::EventPidIs(GetCurrentProcId()))); |
| 823 ASSERT_EQ(events[0]->id, events[1]->id); | 822 ASSERT_EQ(events[0]->id, events[1]->id); |
| 824 ASSERT_EQ(events[0]->id, events[2]->id); | 823 ASSERT_EQ(events[0]->id, events[2]->id); |
| 825 } | 824 } |
| 826 | 825 |
| 827 } // namespace trace_event | 826 } // namespace trace_event |
| 828 } // namespace base | 827 } // namespace base |
| OLD | NEW |