Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -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 | |
Lei Zhang | aa8bf7e | 2015-12-24 19:13:32 -0800 | [diff] [blame] | 8 | #include <memory> |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 9 | #include <vector> |
| 10 | |
dsinclair | 4355468 | 2016-09-29 17:29:48 -0700 | [diff] [blame] | 11 | #include "fxjs/fxjs_v8.h" |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 12 | #include "testing/embedder_test.h" |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 13 | |
| 14 | class 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(); |
tsepez | b469424 | 2016-08-15 16:44:55 -0700 | [diff] [blame] | 24 | CFXJS_Engine* engine() { return m_Engine.get(); } |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 25 | |
| 26 | private: |
Lei Zhang | aa8bf7e | 2015-12-24 19:13:32 -0800 | [diff] [blame] | 27 | std::unique_ptr<FXJS_ArrayBufferAllocator> m_pArrayBufferAllocator; |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 28 | v8::Isolate* m_pIsolate; |
tsepez | b469424 | 2016-08-15 16:44:55 -0700 | [diff] [blame] | 29 | std::unique_ptr<CFXJS_Engine> m_Engine; |
Lei Zhang | 1ac47eb | 2015-12-21 11:04:44 -0800 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | #endif // TESTING_JS_EMBEDDER_TEST_H_ |