summaryrefslogtreecommitdiffstats
path: root/base/process_util_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r--base/process_util_unittest.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 3f53f2a..fe28502 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -365,8 +365,14 @@ TEST_F(ProcessUtilTest, ParseProcStatCPU) {
#endif // defined(OS_POSIX)
-#if defined(OS_LINUX)
// TODO(vandebo) make this work on Windows and Mac too.
+#if defined(OS_LINUX)
+
+#if defined(LINUX_USE_TCMALLOC)
+extern "C" {
+int tc_set_new_mode(int mode);
+}
+#endif // defined(LINUX_USE_TCMALLOC)
class OutOfMemoryTest : public testing::Test {
public:
@@ -381,6 +387,13 @@ class OutOfMemoryTest : public testing::Test {
// Must call EnableTerminationOnOutOfMemory() because that is called from
// chrome's main function and therefore hasn't been called yet.
EnableTerminationOnOutOfMemory();
+#if defined(LINUX_USE_TCMALLOC)
+ tc_set_new_mode(1);
+ }
+
+ virtual void TearDown() {
+ tc_set_new_mode(0);
+#endif // defined(LINUX_USE_TCMALLOC)
}
void* value_;