1 // Copyright 2020 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "testing/fxv8_unittest.h" 6 7 #include <memory> 8 9 #include "fxjs/cfx_v8_array_buffer_allocator.h" 10 #include "v8/include/v8-isolate.h" 11 operator ()(v8::Isolate * ptr) const12void FXV8UnitTest::V8IsolateDeleter::operator()(v8::Isolate* ptr) const { 13 ptr->Dispose(); 14 } 15 16 FXV8UnitTest::FXV8UnitTest() = default; 17 18 FXV8UnitTest::~FXV8UnitTest() = default; 19 SetUp()20void FXV8UnitTest::SetUp() { 21 array_buffer_allocator_ = std::make_unique<CFX_V8ArrayBufferAllocator>(); 22 23 v8::Isolate::CreateParams params; 24 params.array_buffer_allocator = array_buffer_allocator_.get(); 25 isolate_.reset(v8::Isolate::New(params)); 26 } 27