Silencing warnings in audio send stream unit tests.

The unit tests for AudioSendStream was generating a lot of warnings
about "Uninteresting mock function call" on mocked objects. This is due
to the default gmock implementation being NaggyMock and there was no
NiceMock override.

With this change the mocks are replaced with NiceMock implementations
which do not output warnings for unexpected calls. This makes the error
output from the test runner much easier to visually parse to find the
actual errors in failing tests.

Bug: None
Change-Id: Ic40db78159536ddeaa72a468fc2cb3ec17386d44
Reviewed-on: https://webrtc-review.googlesource.com/56220
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22152}
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index c5adca7..43e6c47 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -84,7 +84,8 @@
     const SdpAudioFormat& format) {
   for (const auto& spec : kCodecSpecs) {
     if (format == spec.format) {
-      std::unique_ptr<MockAudioEncoder> encoder(new MockAudioEncoder);
+      std::unique_ptr<MockAudioEncoder> encoder(
+          new testing::NiceMock<MockAudioEncoder>());
       ON_CALL(*encoder.get(), SampleRateHz())
           .WillByDefault(Return(spec.info.sample_rate_hz));
       ON_CALL(*encoder.get(), NumChannels())
@@ -185,6 +186,7 @@
   }
 
   void SetupDefaultChannelProxy(bool audio_bwe_enabled) {
+    EXPECT_TRUE(channel_proxy_ == nullptr);
     channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
     EXPECT_CALL(*channel_proxy_, GetRtpRtcp(_, _))
         .WillRepeatedly(Invoke(
@@ -303,9 +305,9 @@
   AudioProcessingStats audio_processing_stats_;
   SimulatedClock simulated_clock_;
   TimeInterval active_lifetime_;
-  MockRtcEventLog event_log_;
+  testing::NiceMock<MockRtcEventLog> event_log_;
   RtpTransportControllerSend rtp_transport_;
-  MockRtpRtcp rtp_rtcp_;
+  testing::NiceMock<MockRtpRtcp> rtp_rtcp_;
   MockRtcpRttStats rtcp_rtt_stats_;
   testing::NiceMock<MockLimitObserver> limit_observer_;
   BitrateAllocator bitrate_allocator_;