2020-03-27 10:02:58 +00:00
|
|
|
// 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"
|
|
|
|
|
2020-04-07 21:35:29 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2020-05-26 14:40:57 +00:00
|
|
|
#include "test/unittests/heap/cppgc/test-platform.h"
|
|
|
|
|
2020-03-27 10:02:58 +00:00
|
|
|
namespace cppgc {
|
2020-05-06 22:14:44 +00:00
|
|
|
namespace internal {
|
2020-03-27 10:02:58 +00:00
|
|
|
namespace testing {
|
|
|
|
|
|
|
|
// static
|
2020-05-26 14:40:57 +00:00
|
|
|
std::unique_ptr<TestPlatform> TestWithPlatform::platform_;
|
2020-03-27 10:02:58 +00:00
|
|
|
|
|
|
|
// static
|
|
|
|
void TestWithPlatform::SetUpTestSuite() {
|
2020-05-26 14:40:57 +00:00
|
|
|
platform_ = std::make_unique<TestPlatform>();
|
|
|
|
cppgc::InitializePlatform(platform_.get());
|
2020-03-27 10:02:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
void TestWithPlatform::TearDownTestSuite() {
|
|
|
|
cppgc::ShutdownPlatform();
|
2020-05-26 14:40:57 +00:00
|
|
|
platform_.reset();
|
2020-03-27 10:02:58 +00:00
|
|
|
}
|
|
|
|
|
2020-04-07 21:35:29 +00:00
|
|
|
TestWithHeap::TestWithHeap() : heap_(Heap::Create()) {}
|
2020-03-27 10:02:58 +00:00
|
|
|
|
2020-04-07 21:35:29 +00:00
|
|
|
TestSupportingAllocationOnly::TestSupportingAllocationOnly()
|
2020-05-06 22:14:44 +00:00
|
|
|
: no_gc_scope_(internal::Heap::From(GetHeap())) {}
|
2020-03-27 10:02:58 +00:00
|
|
|
|
|
|
|
} // namespace testing
|
2020-05-06 22:14:44 +00:00
|
|
|
} // namespace internal
|
2020-03-27 10:02:58 +00:00
|
|
|
} // namespace cppgc
|