diff --git a/test/cctest/node_test_fixture.cc b/test/cctest/node_test_fixture.cc index 3e5a112240f6d3..1fe6ba477bee65 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 NodeTestFixture::platform; -std::unique_ptr NodeTestFixture::allocator; std::unique_ptr 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 f43cb56cd3a5b5..c9193ffffa76c7 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; class NodeTestFixture : public ::testing::Test { protected: - static std::unique_ptr allocator; + static ArrayBufferUniquePtr allocator; static std::unique_ptr tracing_controller; static std::unique_ptr 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); }