Chromium Code Reviews| Index: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc |
| diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc |
| index 1045e7e2d0fbd111f4c6c8c341a852290e78500f..09a1262c3fa1b3cc12cda631d9c7eb65168edd61 100644 |
| --- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc |
| +++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc |
| @@ -976,7 +976,26 @@ TEST_F(AcmReceiverBitExactnessOldApi, IF_ALL_CODECS(MAYBE_48kHzOutput)) { |
| #endif |
| TEST_F(AcmReceiverBitExactnessOldApi, |
| IF_ALL_CODECS(MAYBE_48kHzOutputExternalDecoder)) { |
| + class DecodeForwarder { |
|
hlundin-webrtc
2015/12/08 10:44:52
Comment on the intended use: forward a call from D
pbos-webrtc
2015/12/08 12:28:27
Done.
|
| + public: |
| + DecodeForwarder(AudioDecoder* decoder) : decoder_(decoder) {} |
| + int Decode(const uint8_t* encoded, |
| + size_t encoded_len, |
| + int sample_rate_hz, |
| + int16_t* decoded, |
| + AudioDecoder::SpeechType* speech_type) { |
| + return decoder_->Decode(encoded, encoded_len, sample_rate_hz, |
| + decoder_->PacketDuration(encoded, encoded_len) * |
| + decoder_->Channels() * sizeof(int16_t), |
| + decoded, speech_type); |
| + } |
| + |
| + private: |
| + AudioDecoder* const decoder_; |
| + }; |
| + |
| AudioDecoderPcmU decoder(1); |
| + DecodeForwarder decode_forwarder(&decoder); |
| MockAudioDecoder mock_decoder; |
| // Set expectations on the mock decoder and also delegate the calls to the |
| // real decoder. |
| @@ -986,9 +1005,9 @@ TEST_F(AcmReceiverBitExactnessOldApi, |
| EXPECT_CALL(mock_decoder, Channels()) |
| .Times(AtLeast(1)) |
| .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::Channels)); |
| - EXPECT_CALL(mock_decoder, Decode(_, _, _, _, _, _)) |
| + EXPECT_CALL(mock_decoder, DecodeInternal(_, _, _, _, _)) |
| .Times(AtLeast(1)) |
| - .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::Decode)); |
| + .WillRepeatedly(Invoke(&decode_forwarder, &DecodeForwarder::Decode)); |
| EXPECT_CALL(mock_decoder, HasDecodePlc()) |
| .Times(AtLeast(1)) |
| .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::HasDecodePlc)); |