blob: 1f27dbeae66ad8151364d3637338853de0b9ca75 [file] [log] [blame]
Philip P. Moltmannac3d58c2016-03-04 15:19:21 -08001// Copyright 2015 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
5#ifndef TESTING_JS_EMBEDDER_TEST_H_
6#define TESTING_JS_EMBEDDER_TEST_H_
7
8#include <memory>
Philip P. Moltmannac3d58c2016-03-04 15:19:21 -08009
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070010#include "fxjs/fxjs_v8.h"
Philip P. Moltmannac3d58c2016-03-04 15:19:21 -080011#include "testing/embedder_test.h"
12
13class JSEmbedderTest : public EmbedderTest {
14 public:
15 JSEmbedderTest();
16 ~JSEmbedderTest() override;
17
18 void SetUp() override;
19 void TearDown() override;
20
21 v8::Isolate* isolate();
22 v8::Local<v8::Context> GetV8Context();
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070023 CFXJS_Engine* engine() { return m_Engine.get(); }
Philip P. Moltmannac3d58c2016-03-04 15:19:21 -080024
25 private:
26 std::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070027 v8::Isolate* m_pIsolate = nullptr;
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070028 std::unique_ptr<CFXJS_Engine> m_Engine;
Philip P. Moltmannac3d58c2016-03-04 15:19:21 -080029};
30
31#endif // TESTING_JS_EMBEDDER_TEST_H_