Chromium Code Reviews| 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(); |
| } |