Index: base/process_util_unittest.cc |
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc |
index 4169dc6b1ec26a5dc9cfcf95aff8744adfd8a62e..15980952b36fed401cbbc5aa3884eb6cd55ee82e 100644 |
--- a/base/process_util_unittest.cc |
+++ b/base/process_util_unittest.cc |
@@ -364,8 +364,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: |
@@ -380,6 +386,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_; |