Philip P. Moltmann | ac3d58c | 2016-03-04 15:19:21 -0800 | [diff] [blame] | 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> |
Philip P. Moltmann | ac3d58c | 2016-03-04 15:19:21 -0800 | [diff] [blame] | 9 | |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 10 | #include "fxjs/fxjs_v8.h" |
Philip P. Moltmann | ac3d58c | 2016-03-04 15:19:21 -0800 | [diff] [blame] | 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(); |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 23 | CFXJS_Engine* engine() { return m_Engine.get(); } |
Philip P. Moltmann | ac3d58c | 2016-03-04 15:19:21 -0800 | [diff] [blame] | 24 | |
| 25 | private: |
| 26 | std::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator; |
Philip P. Moltmann | d904c1e | 2018-03-19 09:26:45 -0700 | [diff] [blame] | 27 | v8::Isolate* m_pIsolate = nullptr; |
Philip P. Moltmann | 4d3acf4 | 2017-03-20 11:05:52 -0700 | [diff] [blame] | 28 | std::unique_ptr<CFXJS_Engine> m_Engine; |
Philip P. Moltmann | ac3d58c | 2016-03-04 15:19:21 -0800 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | #endif // TESTING_JS_EMBEDDER_TEST_H_ |