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

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

Issue 1420363004: Remove special handling of background idle notification in memory reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/memory-reducer.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/memory-reducer-unittest.cc
diff --git a/test/unittests/heap/memory-reducer-unittest.cc b/test/unittests/heap/memory-reducer-unittest.cc
index 3301d13b7efbe07aff6ac940dbf00b02b70e1205..1088f0127d2beaf6d372fe26e758ad109038920b 100644
--- a/test/unittests/heap/memory-reducer-unittest.cc
+++ b/test/unittests/heap/memory-reducer-unittest.cc
@@ -48,12 +48,13 @@ MemoryReducer::Event MarkCompactEventNoGarbageLeft(double time_ms) {
}
-MemoryReducer::Event TimerEvent(double time_ms, bool low_allocation_rate,
+MemoryReducer::Event TimerEvent(double time_ms,
+ bool should_start_incremental_gc,
bool can_start_incremental_gc) {
MemoryReducer::Event event;
event.type = MemoryReducer::kTimer;
event.time_ms = time_ms;
- event.low_allocation_rate = low_allocation_rate;
+ event.should_start_incremental_gc = should_start_incremental_gc;
event.can_start_incremental_gc = can_start_incremental_gc;
return event;
}
@@ -82,16 +83,6 @@ MemoryReducer::Event ContextDisposedEvent(double time_ms) {
}
-MemoryReducer::Event BackgroundIdleNotificationEvent(
- double time_ms, bool can_start_incremental_gc = true) {
- MemoryReducer::Event event;
- event.type = MemoryReducer::kBackgroundIdleNotification;
- event.time_ms = time_ms;
- event.can_start_incremental_gc = can_start_incremental_gc;
- return event;
-}
-
-
TEST(MemoryReducer, FromDoneToDone) {
MemoryReducer::State state0(DoneState()), state1(DoneState());
@@ -103,9 +94,6 @@ TEST(MemoryReducer, FromDoneToDone) {
state1 = MemoryReducer::Step(state0, TimerEventPendingGC(0));
EXPECT_EQ(MemoryReducer::kDone, state1.action);
-
- state1 = MemoryReducer::Step(state0, BackgroundIdleNotificationEvent(0));
- EXPECT_EQ(MemoryReducer::kDone, state1.action);
}
@@ -172,17 +160,6 @@ TEST(MemoryReducer, FromWaitToWait) {
EXPECT_EQ(state0.started_gcs, state1.started_gcs);
EXPECT_EQ(2000, state1.last_gc_time_ms);
- state1 = MemoryReducer::Step(state0, BackgroundIdleNotificationEvent(2000));
- EXPECT_EQ(MemoryReducer::kWait, state1.action);
- EXPECT_EQ(2000 + MemoryReducer::kLongDelayMs, state1.next_gc_start_ms);
- EXPECT_EQ(state0.started_gcs + 1, state1.started_gcs);
-
- state1 =
- MemoryReducer::Step(state0, BackgroundIdleNotificationEvent(2000, false));
- EXPECT_EQ(MemoryReducer::kWait, state1.action);
- EXPECT_EQ(state0.next_gc_start_ms, state1.next_gc_start_ms);
- EXPECT_EQ(state0.started_gcs, state1.started_gcs);
-
state0.last_gc_time_ms = 0;
state1 = MemoryReducer::Step(
state0,
@@ -199,12 +176,6 @@ TEST(MemoryReducer, FromWaitToWait) {
EXPECT_EQ(2000 + MemoryReducer::kLongDelayMs, state1.next_gc_start_ms);
EXPECT_EQ(state0.started_gcs, state1.started_gcs);
EXPECT_EQ(state0.last_gc_time_ms, state1.last_gc_time_ms);
-
- state0.started_gcs = MemoryReducer::kMaxNumberOfGCs;
- state1 = MemoryReducer::Step(state0, BackgroundIdleNotificationEvent(2000));
- EXPECT_EQ(MemoryReducer::kWait, state1.action);
- EXPECT_EQ(state0.next_gc_start_ms, state1.next_gc_start_ms);
- EXPECT_EQ(state0.started_gcs, state1.started_gcs);
}
« no previous file with comments | « src/heap/memory-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698