Index: src/heap/gc-idle-time-handler-unittest.cc |
diff --git a/src/heap/gc-idle-time-handler-unittest.cc b/src/heap/gc-idle-time-handler-unittest.cc |
index 165cac37c101e9188b129581b9de653f6c5f7345..24438ae649f0a15e404fdd62f2681f02318ddf62 100644 |
--- a/src/heap/gc-idle-time-handler-unittest.cc |
+++ b/src/heap/gc-idle-time-handler-unittest.cc |
@@ -192,8 +192,11 @@ TEST_F(GCIdleTimeHandlerTest, StopEventually2) { |
for (int i = 0; i < GCIdleTimeHandler::kMaxMarkCompactsInIdleRound; i++) { |
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); |
EXPECT_EQ(DO_INCREMENTAL_MARKING, action.type); |
+ // In this case we emulate incremental marking steps that finish with a |
+ // full gc. |
handler()->NotifyIdleMarkCompact(); |
} |
+ heap_state.can_start_incremental_marking = false; |
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); |
EXPECT_EQ(DONE, action.type); |
} |
@@ -228,14 +231,18 @@ TEST_F(GCIdleTimeHandlerTest, ContinueAfterStop2) { |
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); |
if (action.type == DONE) break; |
EXPECT_EQ(DO_INCREMENTAL_MARKING, action.type); |
+ // In this case we try to emulate incremental marking steps the finish with |
+ // a full gc. |
handler()->NotifyIdleMarkCompact(); |
} |
+ heap_state.can_start_incremental_marking = false; |
GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); |
EXPECT_EQ(DONE, action.type); |
// Emulate mutator work. |
for (int i = 0; i < GCIdleTimeHandler::kIdleScavengeThreshold; i++) { |
handler()->NotifyScavenge(); |
} |
+ heap_state.can_start_incremental_marking = true; |
action = handler()->Compute(idle_time_ms, heap_state); |
EXPECT_EQ(DO_INCREMENTAL_MARKING, action.type); |
} |