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

Unified Diff: base/process/memory_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/debug/thread_heap_usage_tracker_unittest.cc ('k') | chrome/installer/setup/memory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/memory_unittest.cc
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc
index ecf0b871ecb0415e9ecfc25443c29610cdb7b341..a097897c0b0f3afceab6853198a8d32e96972ad4 100644
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -79,6 +79,10 @@ TEST(ProcessMemoryTest, MacTerminateOnHeapCorruption) {
#else
ADD_FAILURE() << "This test is not supported in this build configuration.";
#endif
+
+#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
+ base::allocator::UninterceptMallocZonesForTesting();
+#endif
}
#endif // defined(OS_MACOSX)
@@ -91,6 +95,10 @@ TEST(MemoryTest, AllocatorShimWorking) {
base::allocator::InterceptAllocationsMac();
#endif
ASSERT_TRUE(base::allocator::IsAllocatorInitialized());
+
+#if defined(OS_MACOSX)
+ base::allocator::UninterceptMallocZonesForTesting();
+#endif
}
// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
@@ -146,6 +154,12 @@ class OutOfMemoryDeathTest : public OutOfMemoryTest {
// should be done inside of the ASSERT_DEATH.
base::EnableTerminationOnOutOfMemory();
}
+
+#if defined(OS_MACOSX)
+ void TearDown() override {
+ base::allocator::UninterceptMallocZonesForTesting();
+ }
+#endif
};
TEST_F(OutOfMemoryDeathTest, New) {
@@ -422,6 +436,12 @@ class OutOfMemoryHandledTest : public OutOfMemoryTest {
// properly by-pass this in order to allow the caller to handle OOM.
base::EnableTerminationOnOutOfMemory();
}
+
+ void TearDown() override {
+#if defined(OS_MACOSX)
+ base::allocator::UninterceptMallocZonesForTesting();
+#endif
+ }
};
#if defined(OS_WIN)
« no previous file with comments | « base/debug/thread_heap_usage_tracker_unittest.cc ('k') | chrome/installer/setup/memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698