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

Unified Diff: base/debug/thread_heap_usage_tracker_unittest.cc

Issue 2727463002: mac: Several minor fixes to allocator shim. (Closed)
Patch Set: more compile error. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/allocator/malloc_zone_functions_mac_unittest.cc ('k') | base/process/memory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/thread_heap_usage_tracker_unittest.cc
diff --git a/base/debug/thread_heap_usage_tracker_unittest.cc b/base/debug/thread_heap_usage_tracker_unittest.cc
index 2012e4971f021581cc574a6024ddb1f6dc701c39..5a6a4fe715398491c99ee21a1c2cb540203239b3 100644
--- a/base/debug/thread_heap_usage_tracker_unittest.cc
+++ b/base/debug/thread_heap_usage_tracker_unittest.cc
@@ -10,6 +10,10 @@
#include "base/allocator/features.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_MACOSX)
+#include "base/allocator/allocator_interception_mac.h"
+#endif
+
namespace base {
namespace debug {
@@ -550,11 +554,14 @@ TEST_F(ThreadHeapUsageTrackerTest, AllShimFunctionsAreProvided) {
}
#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
-TEST(ThreadHeapUsageShimTest, HooksIntoMallocWhenShimAvailable) {
+class ThreadHeapUsageShimTest : public testing::Test {
#if defined(OS_MACOSX)
- allocator::InitializeAllocatorShim();
+ void SetUp() override { allocator::InitializeAllocatorShim(); }
+ void TearDown() override { allocator::UninterceptMallocZonesForTesting(); }
#endif
+};
+TEST_F(ThreadHeapUsageShimTest, HooksIntoMallocWhenShimAvailable) {
ASSERT_FALSE(ThreadHeapUsageTracker::IsHeapTrackingEnabled());
ThreadHeapUsageTracker::EnableHeapTracking();
« no previous file with comments | « base/allocator/malloc_zone_functions_mac_unittest.cc ('k') | base/process/memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698