Make sure that ApmHelpersTest tests don't enter a tight loop.

BUG=webrtc:7219, webrtc:7290
TBR=solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2729133002
Cr-Original-Commit-Position: refs/heads/master@{#16996}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: f0d7b2b5077fd3fb655ea76b8b6e3c4b8ab8afef
diff --git a/media/engine/apm_helpers_unittest.cc b/media/engine/apm_helpers_unittest.cc
index 80b03ad..8c28db7 100644
--- a/media/engine/apm_helpers_unittest.cc
+++ b/media/engine/apm_helpers_unittest.cc
@@ -25,6 +25,11 @@
 
 struct TestHelper {
   TestHelper() {
+    // Reply with a 10ms timer every time TimeUntilNextProcess is called to
+    // avoid entering a tight loop on the process thread.
+    EXPECT_CALL(mock_audio_device_, TimeUntilNextProcess())
+        .WillRepeatedly(testing::Return(10));
+
     // This replicates the conditions from voe_auto_test.
     Config config;
     config.Set<ExperimentalAgc>(new ExperimentalAgc(false));