Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: test/unittests/test-utils.h

Issue 1847543002: Expose a lower bound of malloc'd memory via heap statistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/utils/random-number-generator.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 base::RandomNumberGenerator* random_number_generator() const; 87 base::RandomNumberGenerator* random_number_generator() const;
88 88
89 private: 89 private:
90 DISALLOW_COPY_AND_ASSIGN(TestWithIsolate); 90 DISALLOW_COPY_AND_ASSIGN(TestWithIsolate);
91 }; 91 };
92 92
93 93
94 class TestWithZone : public virtual ::testing::Test { 94 class TestWithZone : public virtual ::testing::Test {
95 public: 95 public:
96 TestWithZone() {} 96 TestWithZone() : zone_(&allocator_) {}
97 virtual ~TestWithZone(); 97 virtual ~TestWithZone();
98 98
99 Zone* zone() { return &zone_; } 99 Zone* zone() { return &zone_; }
100 100
101 private: 101 private:
102 base::AccountingAllocator allocator_;
102 Zone zone_; 103 Zone zone_;
103 104
104 DISALLOW_COPY_AND_ASSIGN(TestWithZone); 105 DISALLOW_COPY_AND_ASSIGN(TestWithZone);
105 }; 106 };
106 107
107 108
108 class TestWithIsolateAndZone : public virtual TestWithIsolate { 109 class TestWithIsolateAndZone : public virtual TestWithIsolate {
109 public: 110 public:
110 TestWithIsolateAndZone() {} 111 TestWithIsolateAndZone() : zone_(&allocator_) {}
111 virtual ~TestWithIsolateAndZone(); 112 virtual ~TestWithIsolateAndZone();
112 113
113 Zone* zone() { return &zone_; } 114 Zone* zone() { return &zone_; }
114 115
115 private: 116 private:
117 base::AccountingAllocator allocator_;
116 Zone zone_; 118 Zone zone_;
117 119
118 DISALLOW_COPY_AND_ASSIGN(TestWithIsolateAndZone); 120 DISALLOW_COPY_AND_ASSIGN(TestWithIsolateAndZone);
119 }; 121 };
120 122
121 } // namespace internal 123 } // namespace internal
122 } // namespace v8 124 } // namespace v8
123 125
124 #endif // V8_UNITTESTS_TEST_UTILS_H_ 126 #endif // V8_UNITTESTS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « test/unittests/compiler/zone-pool-unittest.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698