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

Unified Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 1152743003: Making the MemoryDumpManager less aggressive in disabling dump providers on failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing test and renames Created 5 years, 6 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 c15748c9ab71e10d13b4850f667cc2f17e98772f..bf723b1342d9a3820770078e21976c19dd8f4c14 100644
--- a/base/trace_event/memory_dump_manager_unittest.cc
+++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -250,9 +250,8 @@ TEST_F(MemoryDumpManagerTest, RespectTaskRunnerAffinity) {
DisableTracing();
}
-// Enable both dump providers, make mdp1 fail and assert that only mdp2 is
-// invoked the 2nd time.
-// FIXME(primiano): remove once crbug.com/461788 gets fixed.
+// Enable both dump providers, make sure that mdp gets disabled after 3 failures
+// and not disabled after 1.
TEST_F(MemoryDumpManagerTest, DisableFailingDumpers) {
MockDumpProvider mdp1;
MockDumpProvider mdp2;
@@ -261,13 +260,18 @@ TEST_F(MemoryDumpManagerTest, DisableFailingDumpers) {
mdm_->RegisterDumpProvider(&mdp2);
EnableTracing(kTraceCategory);
- EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false));
- EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(true));
- mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED);
+ const int kFailureCount = 3;
Primiano Tucci (use gerrit) 2015/06/16 11:05:47 At this point I think this constant should be a pr
ssid 2015/06/16 14:52:36 Done.
- EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(0);
- EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false));
- mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED);
+ EXPECT_CALL(mdp1, OnMemoryDump(_))
+ .Times(kFailureCount)
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(mdp2, OnMemoryDump(_))
+ .Times(1 + kFailureCount)
+ .WillOnce(Return(false))
+ .WillRepeatedly(Return(true));
+ for (int i = 0; i < 1 + kFailureCount; i++) {
+ mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED);
+ }
DisableTracing();
}
« 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