diff options
Diffstat (limited to 'test/cctest')
-rw-r--r-- | test/cctest/node_test_fixture.cc | 3 | ||||
-rw-r--r-- | test/cctest/node_test_fixture.h | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/test/cctest/node_test_fixture.cc b/test/cctest/node_test_fixture.cc index 3e5a112240..1fe6ba477b 100644 --- a/test/cctest/node_test_fixture.cc +++ b/test/cctest/node_test_fixture.cc @@ -1,7 +1,6 @@ #include "node_test_fixture.h" +ArrayBufferUniquePtr NodeTestFixture::allocator{nullptr, nullptr}; uv_loop_t NodeTestFixture::current_loop; std::unique_ptr<node::NodePlatform> NodeTestFixture::platform; -std::unique_ptr<v8::ArrayBuffer::Allocator> NodeTestFixture::allocator; std::unique_ptr<v8::TracingController> NodeTestFixture::tracing_controller; -v8::Isolate::CreateParams NodeTestFixture::params; diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index f43cb56cd3..c9193ffffa 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -53,13 +53,14 @@ struct Argv { int nr_args_; }; +using ArrayBufferUniquePtr = std::unique_ptr<node::ArrayBufferAllocator, + decltype(&node::FreeArrayBufferAllocator)>; class NodeTestFixture : public ::testing::Test { protected: - static std::unique_ptr<v8::ArrayBuffer::Allocator> allocator; + static ArrayBufferUniquePtr allocator; static std::unique_ptr<v8::TracingController> tracing_controller; static std::unique_ptr<node::NodePlatform> platform; - static v8::Isolate::CreateParams params; static uv_loop_t current_loop; v8::Isolate* isolate_; @@ -68,8 +69,6 @@ class NodeTestFixture : public ::testing::Test { node::tracing::TraceEventHelper::SetTracingController( tracing_controller.get()); platform.reset(new node::NodePlatform(4, nullptr)); - allocator.reset(v8::ArrayBuffer::Allocator::NewDefaultAllocator()); - params.array_buffer_allocator = allocator.get(); CHECK_EQ(0, uv_loop_init(¤t_loop)); v8::V8::InitializePlatform(platform.get()); v8::V8::Initialize(); @@ -85,7 +84,9 @@ class NodeTestFixture : public ::testing::Test { } virtual void SetUp() { - isolate_ = v8::Isolate::New(params); + allocator = ArrayBufferUniquePtr(node::CreateArrayBufferAllocator(), + &node::FreeArrayBufferAllocator); + isolate_ = NewIsolate(allocator.get()); CHECK_NE(isolate_, nullptr); } |