Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: testing/js_embedder_test.cpp

Issue 1544493003: Add missing files from commit b426e3edde04. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/js_embedder_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "testing/js_embedder_test.h"
6
7 JSEmbedderTest::JSEmbedderTest()
8 : m_pArrayBufferAllocator(new FXJS_ArrayBufferAllocator) {
9 v8::Isolate::CreateParams params;
10 params.array_buffer_allocator = m_pArrayBufferAllocator.get();
11 m_pIsolate = v8::Isolate::New(params);
12 }
13
14 JSEmbedderTest::~JSEmbedderTest() {
15 m_pIsolate->Dispose();
16 }
17
18 void JSEmbedderTest::SetUp() {
19 EmbedderTest::SetExternalIsolate(m_pIsolate);
20 EmbedderTest::SetUp();
21
22 v8::Isolate::Scope isolate_scope(m_pIsolate);
23 v8::HandleScope handle_scope(m_pIsolate);
24 FXJS_PerIsolateData::SetUp(m_pIsolate);
25 FXJS_InitializeRuntime(m_pIsolate, nullptr, &m_pPersistentContext,
26 &m_StaticObjects);
27 }
28
29 void JSEmbedderTest::TearDown() {
30 FXJS_ReleaseRuntime(m_pIsolate, &m_pPersistentContext, &m_StaticObjects);
31 m_pPersistentContext.Reset();
32 FXJS_Release();
33 EmbedderTest::TearDown();
34 }
35
36 v8::Isolate* JSEmbedderTest::isolate() {
37 return m_pIsolate;
38 }
39
40 v8::Local<v8::Context> JSEmbedderTest::GetV8Context() {
41 return m_pPersistentContext.Get(m_pIsolate);
42 }
OLDNEW
« no previous file with comments | « testing/js_embedder_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698