[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 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. | ||||
4 | |||||
5 | #ifndef GIN_TEST_V8_TEST_H_ | ||||
6 | #define GIN_TEST_V8_TEST_H_ | ||||
7 | |||||
[email protected] | 1b93c23 | 2013-11-19 19:25:12 | [diff] [blame^] | 8 | #include "base/basictypes.h" |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 9 | #include "base/compiler_specific.h" |
[email protected] | 1b93c23 | 2013-11-19 19:25:12 | [diff] [blame^] | 10 | #include "base/memory/scoped_ptr.h" |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 11 | #include "testing/gtest/include/gtest/gtest.h" |
12 | #include "v8/include/v8.h" | ||||
13 | |||||
14 | namespace gin { | ||||
15 | |||||
[email protected] | 1b93c23 | 2013-11-19 19:25:12 | [diff] [blame^] | 16 | class Gin; |
17 | |||||
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 18 | // A base class for tests that use v8. |
19 | class V8Test : public testing::Test { | ||||
20 | public: | ||||
21 | V8Test(); | ||||
22 | virtual ~V8Test(); | ||||
23 | |||||
24 | virtual void SetUp() OVERRIDE; | ||||
25 | virtual void TearDown() OVERRIDE; | ||||
26 | |||||
27 | protected: | ||||
[email protected] | 1b93c23 | 2013-11-19 19:25:12 | [diff] [blame^] | 28 | scoped_ptr<Gin> instance_; |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 29 | v8::Persistent<v8::Context> context_; |
[email protected] | 1b93c23 | 2013-11-19 19:25:12 | [diff] [blame^] | 30 | |
31 | private: | ||||
32 | DISALLOW_COPY_AND_ASSIGN(V8Test); | ||||
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 33 | }; |
34 | |||||
35 | } // namespace gin | ||||
36 | |||||
37 | #endif // GIN_TEST_V8_TEST_H_ |