Index: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc |
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc |
index 823763f091985c3fda5128ef1d8dcd89a45fabdc..8f3e9d7a97eb7eb05564317d95761ffd6a5989e4 100644 |
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc |
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_unittest.cc |
@@ -76,20 +76,23 @@ void CheckDecision(FecControllerStates* states, |
const rtc::Optional<int>& uplink_bandwidth_bps, |
const rtc::Optional<float>& uplink_packet_loss, |
bool expected_enable_fec) { |
- Controller::NetworkMetrics metrics; |
- metrics.uplink_bandwidth_bps = uplink_bandwidth_bps; |
- metrics.uplink_packet_loss_fraction = uplink_packet_loss; |
- |
+ if (uplink_bandwidth_bps) { |
+ Controller::NetworkMetrics network_metrics; |
+ network_metrics.uplink_bandwidth_bps = uplink_bandwidth_bps; |
+ states->controller->UpdateNetworkMetrics(network_metrics); |
+ } |
if (uplink_packet_loss) { |
- // Check that smoothing filter is updated. |
+ Controller::NetworkMetrics network_metrics; |
+ network_metrics.uplink_packet_loss_fraction = uplink_packet_loss; |
EXPECT_CALL(*states->packet_loss_smoothed, AddSample(*uplink_packet_loss)); |
+ states->controller->UpdateNetworkMetrics(network_metrics); |
} |
EXPECT_CALL(*states->packet_loss_smoothed, GetAverage()) |
.WillRepeatedly(Return(uplink_packet_loss)); |
AudioNetworkAdaptor::EncoderRuntimeConfig config; |
- states->controller->MakeDecision(metrics, &config); |
+ states->controller->MakeDecision(&config); |
EXPECT_EQ(rtc::Optional<bool>(expected_enable_fec), config.enable_fec); |
// Check that |config.uplink_packet_loss_fraction| is properly filled. |