blob: e9f9d5c9af15dd493afd456fb406c67a8d4331a3 [file] [log] [blame]
Tom Sepez1b6a47d2020-07-21 23:32:19 +00001// Copyright 2020 PDFium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Tom Sepezf5397f02020-07-23 21:22:40 +00005#include "testing/fxv8_unittest.h"
Tom Sepez1b6a47d2020-07-21 23:32:19 +00006
7#include "fxjs/cfx_v8.h"
8#include "v8/include/v8.h"
9
10void FXV8UnitTest::V8IsolateDeleter::operator()(v8::Isolate* ptr) const {
11 ptr->Dispose();
12}
13
14FXV8UnitTest::FXV8UnitTest() = default;
15
16FXV8UnitTest::~FXV8UnitTest() = default;
17
18void FXV8UnitTest::SetUp() {
19 array_buffer_allocator_ = std::make_unique<CFX_V8ArrayBufferAllocator>();
20
21 v8::Isolate::CreateParams params;
22 params.array_buffer_allocator = array_buffer_allocator_.get();
23 isolate_.reset(v8::Isolate::New(params));
24}