1 // Copyright 2014 the V8 project 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 "src/test/test-utils.h"
7 #include "src/isolate-inl.h"
12 Isolate* TestWithIsolate::isolate_ = NULL;
15 TestWithIsolate::TestWithIsolate()
16 : isolate_scope_(isolate()), handle_scope_(isolate()) {}
19 TestWithIsolate::~TestWithIsolate() {}
23 void TestWithIsolate::SetUpTestCase() {
24 Test::SetUpTestCase();
25 EXPECT_EQ(NULL, isolate_);
26 isolate_ = v8::Isolate::New();
27 EXPECT_TRUE(isolate_ != NULL);
32 void TestWithIsolate::TearDownTestCase() {
33 ASSERT_TRUE(isolate_ != NULL);
36 Test::TearDownTestCase();
40 TestWithContext::TestWithContext()
41 : context_(Context::New(isolate())), context_scope_(context_) {}
44 TestWithContext::~TestWithContext() {}
49 TestWithIsolate::~TestWithIsolate() {}
52 Factory* TestWithIsolate::factory() const { return isolate()->factory(); }
55 TestWithZone::~TestWithZone() {}
57 } // namespace internal