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 TEST_F(MemoryDumpManagerTest, DisableTracingWhileDumping) { | 720 // TODO(ssid): Enable this test once crbug.com/555584 is fixed. |
| 721 TEST_F(MemoryDumpManagerTest, DISABLED_DisableTracingWhileDumping) { |
721 base::WaitableEvent tracing_disabled_event(false, false); | 722 base::WaitableEvent tracing_disabled_event(false, false); |
722 InitializeMemoryDumpManager(false /* is_coordinator */); | 723 InitializeMemoryDumpManager(false /* is_coordinator */); |
723 | 724 |
724 // Register a bound dump provider. | 725 // Register a bound dump provider. |
725 scoped_ptr<Thread> mdp_thread(new Thread("test thread")); | 726 scoped_ptr<Thread> mdp_thread(new Thread("test thread")); |
726 mdp_thread->Start(); | 727 mdp_thread->Start(); |
727 MockMemoryDumpProvider mdp_with_affinity; | 728 MockMemoryDumpProvider mdp_with_affinity; |
728 RegisterDumpProvider(&mdp_with_affinity, mdp_thread->task_runner(), | 729 RegisterDumpProvider(&mdp_with_affinity, mdp_thread->task_runner(), |
729 kDefaultOptions); | 730 kDefaultOptions); |
730 | 731 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(123))); | 819 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(123))); |
819 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(456))); | 820 ASSERT_EQ(1u, trace_analyzer::CountMatches(events, Query::EventPidIs(456))); |
820 ASSERT_EQ(1u, trace_analyzer::CountMatches( | 821 ASSERT_EQ(1u, trace_analyzer::CountMatches( |
821 events, Query::EventPidIs(GetCurrentProcId()))); | 822 events, Query::EventPidIs(GetCurrentProcId()))); |
822 ASSERT_EQ(events[0]->id, events[1]->id); | 823 ASSERT_EQ(events[0]->id, events[1]->id); |
823 ASSERT_EQ(events[0]->id, events[2]->id); | 824 ASSERT_EQ(events[0]->id, events[2]->id); |
824 } | 825 } |
825 | 826 |
826 } // namespace trace_event | 827 } // namespace trace_event |
827 } // namespace base | 828 } // namespace base |
OLD | NEW |