OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ | |
6 #define C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ | |
7 | |
8 #include <cassert> | |
9 #include "gtest/gtest.h" | |
10 | |
11 namespace pp { | |
12 class Instance; | |
13 } // namespace pp | |
14 | |
15 namespace c_salt { | |
16 | |
17 // A custom environment for NaCl gtest. | |
18 class GTestNaclEnvironment : public ::testing::Environment { | |
19 public: | |
20 // Set the global NaCl instance that will be shared by all the tests. | |
21 static void set_global_instance(pp::Instance* instance) { | |
22 global_instance_ = instance; | |
23 } | |
24 | |
25 // Get the global NaCl instance. | |
26 static pp::Instance* global_instance() { return global_instance_; } | |
27 | |
28 // Environment overrides. | |
29 virtual void SetUp(); | |
30 virtual void TearDown(); | |
31 | |
32 private: | |
33 static pp::Instance* global_instance_; | |
34 }; | |
35 | |
36 } // namespace c_salt | |
37 | |
38 #endif // C_SALT_TEST_GTEST_NACL_ENVIRONMENT_H_ | |
39 | |
OLD | NEW |