[heap] Fix GrowAndShrinkNewSpace heap test
BUG=
Review-Url: https://codereview.chromium.org/2659573002
Cr-Commit-Position: refs/heads/master@{#42837}
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 2183c887..fd0a529 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -2338,6 +2338,10 @@
return;
}
+ // Make sure we're in a consistent state to start out.
+ CcTest::CollectGarbage(NEW_SPACE);
+ CcTest::CollectGarbage(NEW_SPACE);
+
// Explicitly growing should double the space capacity.
size_t old_capacity, new_capacity;
old_capacity = new_space->TotalCapacity();