Commit fbe43221 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

cppgc: One more unittest

Bug: chromium:1056170
Change-Id: Id3456a36e05379a517f5c49ea0252caa91221519
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2848466Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74150}
parent f0919fe6
......@@ -190,5 +190,21 @@ TEST_F(ExplicitManagementTest, ShrinkFreeListBailoutAvoidFragmentation) {
ObjectAllocator::kSmallestSpaceSize - 1}));
}
TEST_F(ExplicitManagementTest, ResizeBailsOutDuringGC) {
auto* o = MakeGarbageCollected<DynamicallySized>(
GetHeap()->GetAllocationHandle(),
AdditionalBytes(ObjectAllocator::kSmallestSpaceSize - 1));
auto* heap = BasePage::FromPayload(o)->heap();
heap->SetInAtomicPauseForTesting(true);
const size_t allocated_size_before = AllocatedObjectSize();
// Grow:
EXPECT_FALSE(
subtle::Resize(*o, AdditionalBytes(ObjectAllocator::kSmallestSpaceSize)));
// Shrink:
EXPECT_FALSE(subtle::Resize(*o, AdditionalBytes(0)));
EXPECT_EQ(allocated_size_before, AllocatedObjectSize());
heap->SetInAtomicPauseForTesting(false);
}
} // namespace internal
} // namespace cppgc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment