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

Unified Diff: test/heap-unittests/heap-unittest.cc

Issue 492763002: Move idle notification handling to GCIdleTimeHandler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Casts Created 6 years, 4 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
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/heap-unittests/heap-unittest.cc
diff --git a/test/heap-unittests/heap-unittest.cc b/test/heap-unittests/heap-unittest.cc
index db331f91e068089b78c748a197547cd4864b22ac..f51908bc1ab13ba8d53daddfae516564bcefe2b5 100644
--- a/test/heap-unittests/heap-unittest.cc
+++ b/test/heap-unittests/heap-unittest.cc
@@ -45,5 +45,29 @@ TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeOverflow2) {
step_size);
}
+
+TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeInitial) {
+ size_t size = 100 * MB;
+ size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, 0);
+ EXPECT_EQ(size / GCIdleTimeHandler::kInitialConservativeMarkCompactSpeed,
+ time);
+}
+
+
+TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeNonZero) {
+ size_t size = 100 * MB;
+ size_t speed = 10 * KB;
+ size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
+ EXPECT_EQ(size / speed, time);
+}
+
+
+TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeMax) {
+ size_t size = std::numeric_limits<size_t>::max();
+ size_t speed = 1;
+ size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
+ EXPECT_EQ(GCIdleTimeHandler::kMaxMarkCompactTimeInMs, time);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698