blob: 0757c732532a40ee1c584fe0bad5454debc3854f [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// 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#ifndef TESTING_FXV8_UNITTEST_H_
6#define TESTING_FXV8_UNITTEST_H_
7
8#include <memory>
9
10#include "testing/gtest/include/gtest/gtest.h"
11
12class CFX_V8;
13class CFX_V8ArrayBufferAllocator;
14
15namespace v8 {
16class Isolate;
17} // namespace v8
18
19class FXV8UnitTest : public ::testing::Test {
20 public:
21 struct V8IsolateDeleter {
22 void operator()(v8::Isolate* ptr) const;
23 };
24
25 FXV8UnitTest();
26 ~FXV8UnitTest() override;
27
28 void SetUp() override;
29
30 v8::Isolate* isolate() const { return isolate_.get(); }
31
32 protected:
33 std::unique_ptr<CFX_V8ArrayBufferAllocator> array_buffer_allocator_;
34 std::unique_ptr<v8::Isolate, V8IsolateDeleter> isolate_;
35};
36
37#endif // TESTING_FXV8_UNITTEST_H_