Index: test/cctest/heap/test-incremental-marking.cc |
diff --git a/test/cctest/heap/test-incremental-marking.cc b/test/cctest/heap/test-incremental-marking.cc |
index 59697a94a1fed1b2c695918ab45aaf3af1ec8c34..643f7859b2e85901a00296ed4d94b28e06dc17f6 100644 |
--- a/test/cctest/heap/test-incremental-marking.cc |
+++ b/test/cctest/heap/test-incremental-marking.cc |
@@ -140,18 +140,25 @@ TEST(IncrementalMarkingUsingIdleTasks) { |
TEST(IncrementalMarkingUsingIdleTasksAfterGC) { |
if (!i::FLAG_incremental_marking) return; |
+ |
+ const double kLongIdleTimeInSeconds = 1; |
+ const double kShortIdleTimeInSeconds = 0.010; |
+ |
CcTest::InitializeVM(); |
v8::Platform* old_platform = i::V8::GetCurrentPlatform(); |
MockPlatform platform(old_platform); |
i::V8::SetPlatformForTesting(&platform); |
i::heap::SimulateFullSpace(CcTest::heap()->old_space()); |
CcTest::heap()->CollectAllGarbage(); |
+ // Perform any pending idle tasks. |
+ while (platform.PendingIdleTask()) { |
+ platform.PerformIdleTask(kLongIdleTimeInSeconds); |
+ } |
+ CHECK(!platform.PendingIdleTask()); |
i::IncrementalMarking* marking = CcTest::heap()->incremental_marking(); |
marking->Stop(); |
marking->Start(); |
CHECK(platform.PendingIdleTask()); |
- const double kLongIdleTimeInSeconds = 1; |
- const double kShortIdleTimeInSeconds = 0.010; |
const int kShortStepCount = 10; |
for (int i = 0; i < kShortStepCount && platform.PendingIdleTask(); i++) { |
platform.PerformIdleTask(kShortIdleTimeInSeconds); |