Index: runtime/vm/object_test.cc |
=================================================================== |
--- runtime/vm/object_test.cc (revision 37763) |
+++ runtime/vm/object_test.cc (working copy) |
@@ -2061,9 +2061,15 @@ |
value = Smi::New(i); |
array.Add(value); |
} |
+ Heap* heap = Isolate::Current()->heap(); |
+ heap->CollectAllGarbage(); |
+ intptr_t capacity_before = heap->CapacityInWords(Heap::kOld); |
new_array = Array::MakeArray(array); |
EXPECT_EQ(1, new_array.Length()); |
- Isolate::Current()->heap()->CollectAllGarbage(); |
+ heap->CollectAllGarbage(); |
+ intptr_t capacity_after = heap->CapacityInWords(Heap::kOld); |
+ // Page should shrink. |
+ EXPECT_LT(capacity_after, capacity_before); |
EXPECT_EQ(1, new_array.Length()); |
} |