OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef V8_UNITTESTS_TEST_ISOLATE_H_ | |
6 #define V8_UNITTESTS_TEST_ISOLATE_H_ | |
7 | |
8 #include "test/unittests/unittests.h" | |
9 | |
10 namespace v8 { | |
11 namespace internal { | |
12 | |
13 class IsolateTest : public EngineTest { | |
14 public: | |
15 IsolateTest(); | |
16 virtual ~IsolateTest(); | |
17 | |
18 v8::Isolate* isolate() const; | |
19 Isolate* i_isolate() const { return reinterpret_cast<Isolate*>(isolate()); } | |
20 | |
21 private: | |
22 v8::Isolate* isolate_; | |
23 | |
24 DISALLOW_COPY_AND_ASSIGN(IsolateTest); | |
25 }; | |
26 | |
27 | |
28 class ContextTest : public virtual IsolateTest { | |
29 public: | |
30 ContextTest() | |
31 : handle_scope_(isolate()), context_scope_(v8::Context::New(isolate())) {} | |
32 virtual ~ContextTest() {} | |
33 | |
34 private: | |
35 v8::HandleScope handle_scope_; | |
36 v8::Context::Scope context_scope_; | |
37 }; | |
38 | |
39 } // namespace internal | |
40 } // namespace v8 | |
41 | |
42 #endif // V8_UNITTESTS_TEST_ISOLATE_H_ | |
OLD | NEW |