Added unit tests for new congestion controller.

This CL activates unit tests for the task queue based send side
congestion controller that will replace the current one in the future.

To be able to have the tests run side by side with the tests of the old
congestion controller, the old tests have been prefixed with "Legacy".

This CL also contains some minor fixes to the new congestion controller
code.

Bug: webrtc:8415
Change-Id: I5e7474d42f17fcbfef402e26f638846fa3424695
Reviewed-on: https://webrtc-review.googlesource.com/55381
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22229}
diff --git a/modules/congestion_controller/probe_controller_unittest.cc b/modules/congestion_controller/probe_controller_unittest.cc
index 3477c87..da333d3 100644
--- a/modules/congestion_controller/probe_controller_unittest.cc
+++ b/modules/congestion_controller/probe_controller_unittest.cc
@@ -38,25 +38,25 @@
 
 }  // namespace
 
-class ProbeControllerTest : public ::testing::Test {
+class LegacyProbeControllerTest : public ::testing::Test {
  protected:
-  ProbeControllerTest() : clock_(100000000L) {
+  LegacyProbeControllerTest() : clock_(100000000L) {
     probe_controller_.reset(new ProbeController(&pacer_, &clock_));
   }
-  ~ProbeControllerTest() override {}
+  ~LegacyProbeControllerTest() override {}
 
   SimulatedClock clock_;
   NiceMock<MockPacedSender> pacer_;
   std::unique_ptr<ProbeController> probe_controller_;
 };
 
-TEST_F(ProbeControllerTest, InitiatesProbingAtStart) {
+TEST_F(LegacyProbeControllerTest, InitiatesProbingAtStart) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
 }
 
-TEST_F(ProbeControllerTest, ProbeOnlyWhenNetworkIsUp) {
+TEST_F(LegacyProbeControllerTest, ProbeOnlyWhenNetworkIsUp) {
   probe_controller_->OnNetworkStateChanged(kNetworkDown);
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(0);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -67,7 +67,7 @@
   probe_controller_->OnNetworkStateChanged(kNetworkUp);
 }
 
-TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
+TEST_F(LegacyProbeControllerTest, InitiatesProbingOnMaxBitrateIncrease) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -81,7 +81,8 @@
                                  kMaxBitrateBps + 100);
 }
 
-TEST_F(ProbeControllerTest, InitiatesProbingOnMaxBitrateIncreaseAtMaxBitrate) {
+TEST_F(LegacyProbeControllerTest,
+       InitiatesProbingOnMaxBitrateIncreaseAtMaxBitrate) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(AtLeast(2));
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -96,7 +97,7 @@
                                  kMaxBitrateBps + 100);
 }
 
-TEST_F(ProbeControllerTest, TestExponentialProbing) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbing) {
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
 
@@ -110,7 +111,7 @@
   probe_controller_->SetEstimatedBitrate(1800);
 }
 
-TEST_F(ProbeControllerTest, TestExponentialProbingTimeout) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbingTimeout) {
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
 
@@ -122,7 +123,7 @@
   probe_controller_->SetEstimatedBitrate(1800);
 }
 
-TEST_F(ProbeControllerTest, RequestProbeInAlr) {
+TEST_F(LegacyProbeControllerTest, RequestProbeInAlr) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -137,7 +138,7 @@
   probe_controller_->RequestProbe();
 }
 
-TEST_F(ProbeControllerTest, RequestProbeWhenAlrEndedRecently) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenAlrEndedRecently) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -154,7 +155,7 @@
   probe_controller_->RequestProbe();
 }
 
-TEST_F(ProbeControllerTest, RequestProbeWhenAlrNotEndedRecently) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenAlrNotEndedRecently) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -171,7 +172,7 @@
   probe_controller_->RequestProbe();
 }
 
-TEST_F(ProbeControllerTest, RequestProbeWhenBweDropNotRecent) {
+TEST_F(LegacyProbeControllerTest, RequestProbeWhenBweDropNotRecent) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
                                  kMaxBitrateBps);
@@ -187,7 +188,7 @@
   probe_controller_->RequestProbe();
 }
 
-TEST_F(ProbeControllerTest, PeriodicProbing) {
+TEST_F(LegacyProbeControllerTest, PeriodicProbing) {
   EXPECT_CALL(pacer_, CreateProbeCluster(_)).Times(2);
   probe_controller_->EnablePeriodicAlrProbing(true);
   probe_controller_->SetBitrates(kMinBitrateBps, kStartBitrateBps,
@@ -224,7 +225,7 @@
   testing::Mock::VerifyAndClearExpectations(&pacer_);
 }
 
-TEST_F(ProbeControllerTest, PeriodicProbingAfterReset) {
+TEST_F(LegacyProbeControllerTest, PeriodicProbingAfterReset) {
   testing::StrictMock<MockPacedSender> local_pacer;
   probe_controller_.reset(new ProbeController(&local_pacer, &clock_));
   int64_t alr_start_time = clock_.TimeInMilliseconds();
@@ -251,7 +252,7 @@
   probe_controller_->Process();
 }
 
-TEST_F(ProbeControllerTest, TestExponentialProbingOverflow) {
+TEST_F(LegacyProbeControllerTest, TestExponentialProbingOverflow) {
   const int64_t kMbpsMultiplier = 1000000;
   probe_controller_->SetBitrates(kMinBitrateBps, 10 * kMbpsMultiplier,
                                  100 * kMbpsMultiplier);