1 // 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>
9 
10 #include "fxjs/fxjs_v8.h"
11 #include "testing/embedder_test.h"
12 
13 class 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();
engine()23   CFXJS_Engine* engine() { return m_Engine.get(); }
24 
25  private:
26   std::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator;
27   v8::Isolate* m_pIsolate = nullptr;
28   std::unique_ptr<CFXJS_Engine> m_Engine;
29 };
30 
31 #endif  // TESTING_JS_EMBEDDER_TEST_H_
32