| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_UNITTESTS_TEST_UTILS_H_ | 5 #ifndef V8_UNITTESTS_TEST_UTILS_H_ |
| 6 #define V8_UNITTESTS_TEST_UTILS_H_ | 6 #define V8_UNITTESTS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/base/macros.h" | 9 #include "src/base/macros.h" |
| 10 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/zone.h" | 11 #include "src/zone.h" |
| 11 #include "testing/gtest-support.h" | 12 #include "testing/gtest-support.h" |
| 12 | 13 |
| 13 namespace v8 { | 14 namespace v8 { |
| 14 | 15 |
| 15 class TestWithIsolate : public ::testing::Test { | 16 class TestWithIsolate : public ::testing::Test { |
| 16 public: | 17 public: |
| 17 TestWithIsolate(); | 18 TestWithIsolate(); |
| 18 virtual ~TestWithIsolate(); | 19 virtual ~TestWithIsolate(); |
| 19 | 20 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 const Local<Context>& context() const { return context_; } | 40 const Local<Context>& context() const { return context_; } |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 Local<Context> context_; | 43 Local<Context> context_; |
| 43 Context::Scope context_scope_; | 44 Context::Scope context_scope_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(TestWithContext); | 46 DISALLOW_COPY_AND_ASSIGN(TestWithContext); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 | 49 |
| 50 namespace base { |
| 51 |
| 52 class TestWithRandomNumberGenerator : public ::testing::Test { |
| 53 public: |
| 54 TestWithRandomNumberGenerator(); |
| 55 virtual ~TestWithRandomNumberGenerator(); |
| 56 |
| 57 RandomNumberGenerator* rng() { return &rng_; } |
| 58 |
| 59 private: |
| 60 RandomNumberGenerator rng_; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(TestWithRandomNumberGenerator); |
| 63 }; |
| 64 |
| 65 } // namespace base |
| 66 |
| 67 |
| 49 namespace internal { | 68 namespace internal { |
| 50 | 69 |
| 51 // Forward declarations. | 70 // Forward declarations. |
| 52 class Factory; | 71 class Factory; |
| 53 | 72 |
| 54 | 73 |
| 55 class TestWithIsolate : public virtual ::v8::TestWithIsolate { | 74 class TestWithIsolate : public virtual ::v8::TestWithIsolate { |
| 56 public: | 75 public: |
| 57 TestWithIsolate() {} | 76 TestWithIsolate() {} |
| 58 virtual ~TestWithIsolate(); | 77 virtual ~TestWithIsolate(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 77 private: | 96 private: |
| 78 Zone zone_; | 97 Zone zone_; |
| 79 | 98 |
| 80 DISALLOW_COPY_AND_ASSIGN(TestWithZone); | 99 DISALLOW_COPY_AND_ASSIGN(TestWithZone); |
| 81 }; | 100 }; |
| 82 | 101 |
| 83 } // namespace internal | 102 } // namespace internal |
| 84 } // namespace v8 | 103 } // namespace v8 |
| 85 | 104 |
| 86 #endif // V8_UNITTESTS_TEST_UTILS_H_ | 105 #endif // V8_UNITTESTS_TEST_UTILS_H_ |
| OLD | NEW |