Fix exponential probing in ProbeController.

https://codereview.webrtc.org/2504023002 broke exponential probing.
After that change ProbeController stops exponential probes prematurely:
it goes to kProbingComplete state if SetEstimatedBitrate() is called
with bitrate lower than min_bitrate_to_probe_further_bps_, which always
happens with the first pair of probes. As result it wasn't sending
repeated probes as it should. This change fixes that issue by moving
probe expieration logic to ProbeContoller::Process(). This also ensures
that the controller goes to kProbingComplete state as soon as probing
timeout expired, without waiting for the next SetEstimatedBitrate()
call.

BUG=669421

Review-Url: https://codereview.webrtc.org/2546613003
Cr-Commit-Position: refs/heads/master@{#15392}
diff --git a/webrtc/modules/congestion_controller/probe_controller_unittest.cc b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
index 3c43cfe..61ca559 100644
--- a/webrtc/modules/congestion_controller/probe_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/probe_controller_unittest.cc
@@ -72,6 +72,7 @@
   // Long enough to time out exponential probing.
   clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
   probe_controller_->SetEstimatedBitrate(kStartBitrateBps);
+  probe_controller_->Process();
 
   EXPECT_CALL(pacer_, CreateProbeCluster(kMaxBitrateBps + 100, _));
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -82,6 +83,12 @@
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
 
+  // Repeated probe should only be sent when estimated bitrate climbs above 4 *
+  // kStartBitrateBps = 1200.
+  EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
+  probe_controller_->SetEstimatedBitrate(1000);
+  testing::Mock::VerifyAndClearExpectations(&pacer_);
+
   EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _));
   probe_controller_->SetEstimatedBitrate(1800);
 }
@@ -92,7 +99,9 @@
 
   // Advance far enough to cause a time out in waiting for probing result.
   clock_.AdvanceTimeMilliseconds(kExponentialProbingTimeoutMs);
-  EXPECT_CALL(pacer_, CreateProbeCluster(2 * 1800, _)).Times(0);
+  probe_controller_->Process();
+
+  EXPECT_CALL(pacer_, CreateProbeCluster(_, _)).Times(0);
   probe_controller_->SetEstimatedBitrate(1800);
 }
 
@@ -110,6 +119,7 @@
       .WillRepeatedly(
           Return(rtc::Optional<int64_t>(clock_.TimeInMilliseconds())));
   clock_.AdvanceTimeMilliseconds(kAlrProbeInterval + 1);
+  probe_controller_->Process();
   probe_controller_->SetEstimatedBitrate(50);
 }