Only use BBRs pacer if the unit test is running BBR.
Otherwise use WebRTCs default pacer.
BUG=None
Review-Url: https://codereview.webrtc.org/3009363002
Cr-Original-Commit-Position: refs/heads/master@{#19797}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 661d94996b0301cee460d0e486e8371a05977aca
diff --git a/modules/remote_bitrate_estimator/test/packet_sender.cc b/modules/remote_bitrate_estimator/test/packet_sender.cc
index 33209ca..1eed380 100644
--- a/modules/remote_bitrate_estimator/test/packet_sender.cc
+++ b/modules/remote_bitrate_estimator/test/packet_sender.cc
@@ -159,9 +159,10 @@
VideoSource* source,
BandwidthEstimatorType estimator)
: VideoSender(listener, source, estimator),
- // Ugly hack to use BBR's pacer.
- // TODO(gnish): Make pacer choice dependant on the algorithm being used.
- pacer_(new BbrPacedSender(&clock_, this, nullptr)) {
+ pacer_(
+ estimator == kBbrEstimator
+ ? static_cast<Pacer*>(new BbrPacedSender(&clock_, this, nullptr))
+ : static_cast<Pacer*>(new PacedSender(&clock_, this, nullptr))) {
modules_.push_back(pacer_.get());
pacer_->SetEstimatedBitrate(source->bits_per_second());
}