blob: b2bd5a87b1a017651b26695afea5030233da45ca [file] [log] [blame]
Lei Zhang1ac47eb2015-12-21 11:04:44 -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
Lei Zhangaa8bf7e2015-12-24 19:13:32 -08008#include <memory>
Lei Zhang1ac47eb2015-12-21 11:04:44 -08009#include <vector>
10
dsinclairb3f24672016-07-12 10:42:14 -070011#include "fxjs/include/fxjs_v8.h"
Lei Zhang1ac47eb2015-12-21 11:04:44 -080012#include "testing/embedder_test.h"
Lei Zhang1ac47eb2015-12-21 11:04:44 -080013
14class JSEmbedderTest : public EmbedderTest {
15 public:
16 JSEmbedderTest();
17 ~JSEmbedderTest() override;
18
19 void SetUp() override;
20 void TearDown() override;
21
22 v8::Isolate* isolate();
23 v8::Local<v8::Context> GetV8Context();
24
25 private:
Lei Zhangaa8bf7e2015-12-24 19:13:32 -080026 std::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
Lei Zhang1ac47eb2015-12-21 11:04:44 -080027 v8::Isolate* m_pIsolate;
28 v8::Global<v8::Context> m_pPersistentContext;
29 std::vector<v8::Global<v8::Object>*> m_StaticObjects;
30};
31
32#endif // TESTING_JS_EMBEDDER_TEST_H_