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

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 1466293002: Fix regression in memory-infra bots due to change in dump order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « 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