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 "include/v8.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | |
10 | |
11 namespace v8 { | |
12 namespace internal { | |
13 | |
14 // Forward declarations. | |
15 class Isolate; | |
16 | |
17 class IsolateTest : public ::testing::Test { | |
18 public: | |
19 IsolateTest(); | |
20 ~IsolateTest(); | |
jochen (gone - plz use gerrit)
2014/08/05 07:36:19
i bet that needs to be virtual (and all other test
Benedikt Meurer
2014/08/05 08:01:53
Done.
| |
21 | |
22 v8::Isolate* isolate() const; | |
23 Isolate* i_isolate() const { return reinterpret_cast<Isolate*>(isolate()); } | |
24 | |
25 private: | |
26 v8::Isolate* isolate_; | |
27 }; | |
jochen (gone - plz use gerrit)
2014/08/05 07:36:19
DISALLOW_COPY_AND_ASSIGN()....
Benedikt Meurer
2014/08/05 08:01:52
Done.
| |
28 | |
29 | |
30 class ContextTest : public virtual IsolateTest { | |
31 public: | |
32 ContextTest() | |
33 : handle_scope_(isolate()), context_scope_(v8::Context::New(isolate())) {} | |
34 | |
35 private: | |
36 v8::HandleScope handle_scope_; | |
37 v8::Context::Scope context_scope_; | |
38 }; | |
39 | |
40 } // namespace internal | |
41 } // namespace v8 | |
42 | |
43 #endif // V8_UNITTESTS_TEST_ISOLATE_H_ | |
OLD | NEW |