Commit e9da717d authored by primiano's avatar primiano Committed by Commit bot

Allocator cleanup: remove reundant tc_set_new_mode in ProcessMemoryTest

Leftover from the previous cleanups.
Previously, when base did pretend to not know anything about allocator,
tc_set_new_mode was invoked by the content layer (in content_main).
But this required this base unittest to mimic the same content behavior.

These days, instead, tc_set_new_mode() is called by base's
EnableTerminationOnOutOfMemory(). This test is already invoking
EnableTerminationOnOutOfMemory() in its initialization, so there is
no need to perform a 2nd call to tc_set_new_mode.

Also this makes the code in this test conceptually cleaner and smaller.

BUG=564618
TEST=base_unittests

Review URL: https://codereview.chromium.org/1683153002

Cr-Commit-Position: refs/heads/master@{#374750}
parent 865654e1
......@@ -148,12 +148,6 @@ TEST(ProcessMemoryTest, MacTerminateOnHeapCorruption) {
!(defined(OS_WIN) && !defined(ALLOCATOR_SHIM)) && \
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
#if defined(USE_TCMALLOC)
extern "C" {
int tc_set_new_mode(int mode);
}
#endif // defined(USE_TCMALLOC)
namespace {
const char *kOomRegex = "Out of memory";
} // namespace
......@@ -171,12 +165,6 @@ class OutOfMemoryTest : public testing::Test {
signed_test_size_(std::numeric_limits<ssize_t>::max()) {
}
#if defined(USE_TCMALLOC)
void SetUp() override { tc_set_new_mode(1); }
void TearDown() override { tc_set_new_mode(0); }
#endif // defined(USE_TCMALLOC)
protected:
void* value_;
size_t test_size_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment