Index: testing/js_embedder_test.cpp |
diff --git a/testing/js_embedder_test.cpp b/testing/js_embedder_test.cpp |
index 1b21fe04db119fae2f2a06bca7f3bfceb9b7210d..f7aa7e38f741eb6813e371819ce6c63fecefe018 100644 |
--- a/testing/js_embedder_test.cpp |
+++ b/testing/js_embedder_test.cpp |
@@ -21,13 +21,14 @@ void JSEmbedderTest::SetUp() { |
v8::Isolate::Scope isolate_scope(m_pIsolate); |
v8::HandleScope handle_scope(m_pIsolate); |
FXJS_PerIsolateData::SetUp(m_pIsolate); |
- FXJS_InitializeEngine(m_pIsolate, nullptr, &m_pPersistentContext, |
- &m_StaticObjects); |
+ m_Engine.reset(new CFXJS_Engine); |
+ m_Engine->SetIsolate(m_pIsolate); |
+ m_Engine->InitializeEngine(); |
} |
void JSEmbedderTest::TearDown() { |
- FXJS_ReleaseEngine(m_pIsolate, &m_pPersistentContext, &m_StaticObjects); |
- m_pPersistentContext.Reset(); |
+ m_Engine->ReleaseEngine(); |
+ m_Engine.reset(); |
EmbedderTest::TearDown(); |
m_pIsolate->Dispose(); |
m_pIsolate = nullptr; |
@@ -38,5 +39,5 @@ v8::Isolate* JSEmbedderTest::isolate() { |
} |
v8::Local<v8::Context> JSEmbedderTest::GetV8Context() { |
- return m_pPersistentContext.Get(m_pIsolate); |
+ return m_Engine->GetPersistentContext(); |
} |