Index: test/unittests/heap/gc-idle-time-handler-unittest.cc |
diff --git a/test/unittests/heap/gc-idle-time-handler-unittest.cc b/test/unittests/heap/gc-idle-time-handler-unittest.cc |
index c75fde492e5822fbc5d77fb3d5cfa0db9cd2a000..e74152a5fdcf34d251665c431e57fa7b8e895fc0 100644 |
--- a/test/unittests/heap/gc-idle-time-handler-unittest.cc |
+++ b/test/unittests/heap/gc-idle-time-handler-unittest.cc |
@@ -156,6 +156,19 @@ TEST_F(GCIdleTimeHandlerTest, DoScavengeLowScavengeSpeed) { |
} |
+TEST_F(GCIdleTimeHandlerTest, DoScavengeLowAllocationRate) { |
+ GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); |
+ heap_state.used_new_space_size = kNewSpaceCapacity; |
+ heap_state.new_space_allocation_throughput_in_bytes_per_ms = |
+ GCIdleTimeHandler::kLowAllocationThroughput - 1; |
+ int idle_time_ms = 16; |
+ EXPECT_TRUE(GCIdleTimeHandler::ShouldDoScavenge( |
+ idle_time_ms, heap_state.new_space_capacity, |
+ heap_state.used_new_space_size, heap_state.scavenge_speed_in_bytes_per_ms, |
+ heap_state.new_space_allocation_throughput_in_bytes_per_ms)); |
+} |
+ |
+ |
TEST_F(GCIdleTimeHandlerTest, DoScavengeHighScavengeSpeed) { |
GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); |
heap_state.used_new_space_size = kNewSpaceCapacity; |