// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "test/unittests/heap/cppgc/tests.h" #include #include "src/heap/cppgc/object-allocator.h" #include "test/unittests/heap/cppgc/test-platform.h" namespace cppgc { namespace internal { namespace testing { // static std::shared_ptr TestWithPlatform::platform_; // static void TestWithPlatform::SetUpTestSuite() { platform_ = std::make_unique(); cppgc::InitializeProcess(platform_->GetPageAllocator()); } // static void TestWithPlatform::TearDownTestSuite() { cppgc::ShutdownProcess(); platform_.reset(); } TestWithHeap::TestWithHeap() : heap_(Heap::Create(platform_)), allocation_handle_(heap_->GetAllocationHandle()) {} void TestWithHeap::ResetLinearAllocationBuffers() { Heap::From(GetHeap())->object_allocator().ResetLinearAllocationBuffers(); } TestSupportingAllocationOnly::TestSupportingAllocationOnly() : no_gc_scope_(internal::Heap::From(GetHeap())) {} } // namespace testing } // namespace internal } // namespace cppgc