Add testonly=true to components/pairing:unit_tests
[chromium-blink-merge.git] / gin / test / v8_test.cc
blobcb6d57374762e0199cb0ac795bed068f3f52d7f5
1 // Copyright 2013 The Chromium 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.
5 #include "gin/test/v8_test.h"
7 #include "gin/array_buffer.h"
8 #include "gin/public/isolate_holder.h"
10 using v8::Context;
11 using v8::Local;
12 using v8::HandleScope;
14 namespace gin {
16 V8Test::V8Test() {
19 V8Test::~V8Test() {
22 void V8Test::SetUp() {
23 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
24 gin::ArrayBufferAllocator::SharedInstance());
25 instance_.reset(new gin::IsolateHolder);
26 instance_->isolate()->Enter();
27 HandleScope handle_scope(instance_->isolate());
28 context_.Reset(instance_->isolate(), Context::New(instance_->isolate()));
29 Local<Context>::New(instance_->isolate(), context_)->Enter();
32 void V8Test::TearDown() {
34 HandleScope handle_scope(instance_->isolate());
35 Local<Context>::New(instance_->isolate(), context_)->Exit();
36 context_.Reset();
38 instance_->isolate()->Exit();
39 instance_.reset();
42 } // namespace gin