NetEq: Simplify the dependencies of GetNetworkStatistics

Adds a new method PopulateDelayManagerStats which takes care of the
fields that needed information from the DelayManager.

Also adds a new test for StatisticsCalculator made practically
feasible by the refactoring.

Bug: webrtc:7554
Change-Id: Iff5cb5e209c276bd2784f2ccf73be8f619b1d955
Reviewed-on: https://webrtc-review.googlesource.com/3181
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19957}
diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc
index cdf590b..2d50225 100644
--- a/modules/audio_coding/neteq/neteq_impl.cc
+++ b/modules/audio_coding/neteq/neteq_impl.cc
@@ -374,9 +374,11 @@
       sync_buffer_->FutureLength();
   assert(delay_manager_.get());
   assert(decision_logic_.get());
+  const int ms_per_packet = rtc::dchecked_cast<int>(
+      decision_logic_->packet_length_samples() / (fs_hz_ / 1000));
+  stats_.PopulateDelayManagerStats(ms_per_packet, *delay_manager_.get(), stats);
   stats_.GetNetworkStatistics(fs_hz_, total_samples_in_buffers,
-                              decoder_frame_length_, *delay_manager_.get(),
-                              *decision_logic_.get(), stats);
+                              decoder_frame_length_, stats);
   return 0;
 }