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

Unified Diff: base/process/memory_unittest.cc

Issue 2201363002: android: Enable death on malloc/operator new failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/process/memory_linux.cc ('k') | no next file » | 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 52777165a374d4cb1162ed4ef3a1e125c07fe2fa..91ea1305f6869b1c79d27eb1f8646069c1257271 100644
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -82,13 +82,11 @@ TEST(MemoryTest, AllocatorShimWorking) {
ASSERT_TRUE(base::allocator::IsAllocatorInitialized());
}
-// Android doesn't implement set_new_handler, so we can't use the
-// OutOfMemoryTest cases. OpenBSD does not support these tests either.
-// Don't test these on ASan/TSan/MSan configurations: only test the real
-// allocator.
+// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
+// configurations: only test the real allocator.
// Windows only supports these tests with the allocator shim in place.
-#if !defined(OS_ANDROID) && !defined(OS_OPENBSD) && \
- BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \
+#if !defined(OS_OPENBSD) && \
+ BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
namespace {
@@ -413,9 +411,6 @@ class OutOfMemoryHandledTest : public OutOfMemoryTest {
// TODO(b.kelemen): make UncheckedMalloc and UncheckedCalloc work
// on Windows as well.
-// UncheckedMalloc() and UncheckedCalloc() work as regular malloc()/calloc()
-// under sanitizer tools.
-#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
Primiano Tucci (use gerrit) 2016/08/03 11:30:14 This #if is redundant as the entire block is alrea
TEST_F(OutOfMemoryHandledTest, UncheckedMalloc) {
EXPECT_TRUE(base::UncheckedMalloc(kSafeMallocSize, &value_));
EXPECT_TRUE(value_ != NULL);
@@ -444,6 +439,5 @@ TEST_F(OutOfMemoryHandledTest, UncheckedCalloc) {
EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
EXPECT_TRUE(value_ == NULL);
}
-#endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
-#endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !(defined(OS_WIN) &&
- // !defined(ALLOCATOR_SHIM)) && !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
+#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
+ // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
« no previous file with comments | « base/process/memory_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698