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

Unified Diff: test/unittests/heap/gc-idle-time-handler-unittest.cc

Issue 1023153002: Limit rate of full garbage collections triggered by idle notification. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« test/cctest/test-api.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2076e604faa06d92e29e499c5d12a5eae4420694..ca60468aad5187d848dffe5a8c0690111b79d5a3 100644
--- a/test/unittests/heap/gc-idle-time-handler-unittest.cc
+++ b/test/unittests/heap/gc-idle-time-handler-unittest.cc
@@ -34,6 +34,8 @@ class GCIdleTimeHandlerTest : public ::testing::Test {
result.new_space_capacity = kNewSpaceCapacity;
result.new_space_allocation_throughput_in_bytes_per_ms =
kNewSpaceAllocationThroughput;
+ result.last_mark_compact_time = 0;
+ result.current_time = GCIdleTimeHandler::kMinTimeInBetweenMarkCompactsInMs;
return result;
}
@@ -169,14 +171,24 @@ TEST_F(GCIdleTimeHandlerTest, DoScavengeHighScavengeSpeed) {
TEST_F(GCIdleTimeHandlerTest, ShouldDoMarkCompact) {
size_t idle_time_in_ms = 16;
- EXPECT_TRUE(GCIdleTimeHandler::ShouldDoMarkCompact(idle_time_in_ms, 0, 0));
+ EXPECT_TRUE(GCIdleTimeHandler::ShouldDoMarkCompact(
+ idle_time_in_ms, 0, 0, 0,
+ GCIdleTimeHandler::kMinTimeInBetweenMarkCompactsInMs));
}
TEST_F(GCIdleTimeHandlerTest, DontDoMarkCompact) {
size_t idle_time_in_ms = 1;
EXPECT_FALSE(GCIdleTimeHandler::ShouldDoMarkCompact(
- idle_time_in_ms, kSizeOfObjects, kMarkingSpeed));
+ idle_time_in_ms, kSizeOfObjects, kMarkingSpeed, 0,
+ GCIdleTimeHandler::kMinTimeInBetweenMarkCompactsInMs));
+}
+
+
+TEST_F(GCIdleTimeHandlerTest, DontDoMarkCompactRate) {
+ size_t idle_time_in_ms = 16;
+ EXPECT_FALSE(
+ GCIdleTimeHandler::ShouldDoMarkCompact(idle_time_in_ms, 0, 0, 0, 0));
}
« test/cctest/test-api.cc ('K') | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698