| Index: webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| diff --git a/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc b/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| index 96a04276f2faf071f904a9f50c36b5f7703b3215..6dbe8ec0950d2fb2cd4d80edb96f981386f7d550 100644
|
| --- a/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| +++ b/webrtc/modules/audio_mixer/test/audio_mixer_unittest.cc
|
| @@ -21,7 +21,7 @@
|
| namespace webrtc {
|
|
|
| using testing::_;
|
| -using testing::AtLeast;
|
| +using testing::Exactly;
|
| using testing::Invoke;
|
| using testing::Return;
|
|
|
| @@ -30,19 +30,24 @@ using voe::AudioMixer;
|
| class MockMixerAudioSource : public MixerAudioSource {
|
| public:
|
| MockMixerAudioSource() {
|
| - ON_CALL(*this, GetAudioFrame(_, _))
|
| - .WillByDefault(Invoke(this, &MockMixerAudioSource::FakeAudioFrame));
|
| + ON_CALL(*this, GetAudioFrameWithMuted(_, _))
|
| + .WillByDefault(
|
| + Invoke(this, &MockMixerAudioSource::FakeAudioFrameWithMuted));
|
| }
|
| - MOCK_METHOD2(GetAudioFrame,
|
| - int32_t(const int32_t id, AudioFrame* audio_frame));
|
| + MOCK_METHOD2(GetAudioFrameWithMuted,
|
| + AudioFrameWithInfo(const int32_t id, int sample_rate_hz));
|
| MOCK_CONST_METHOD1(NeededFrequency, int32_t(const int32_t id));
|
| +
|
| AudioFrame* fake_frame() { return &fake_frame_; }
|
|
|
| private:
|
| AudioFrame fake_frame_;
|
| - int32_t FakeAudioFrame(const int32_t id, AudioFrame* audio_frame) {
|
| - audio_frame->CopyFrom(fake_frame_);
|
| - return 0;
|
| + AudioFrameWithInfo FakeAudioFrameWithMuted(const int32_t id,
|
| + int sample_rate_hz) {
|
| + return {
|
| + fake_frame(), // audio_frame_pointer
|
| + AudioFrameInfo::kNormal, // audio_frame_info
|
| + };
|
| }
|
| };
|
|
|
| @@ -169,7 +174,8 @@ TEST(AudioMixer, LargestEnergyVadActiveMixed) {
|
| participants[i].fake_frame()->data_[80] = i;
|
|
|
| EXPECT_EQ(0, mixer->SetMixabilityStatus(&participants[i], true));
|
| - EXPECT_CALL(participants[i], GetAudioFrame(_, _)).Times(AtLeast(1));
|
| + EXPECT_CALL(participants[i], GetAudioFrameWithMuted(_, _))
|
| + .Times(Exactly(1));
|
| EXPECT_CALL(participants[i], NeededFrequency(_))
|
| .WillRepeatedly(Return(kSampleRateHz));
|
| }
|
| @@ -197,7 +203,7 @@ TEST(AudioMixer, LargestEnergyVadActiveMixed) {
|
| }
|
|
|
| TEST_F(BothMixersTest, CompareInitialFrameAudio) {
|
| - EXPECT_CALL(participant_, GetAudioFrame(_, _)).Times(AtLeast(1));
|
| + EXPECT_CALL(participant_, GetAudioFrameWithMuted(_, _)).Times(Exactly(1));
|
|
|
| // Make sure the participant is marked as 'non-mixed' so that it is
|
| // ramped in next round.
|
| @@ -223,7 +229,7 @@ TEST_F(BothMixersTest, CompareInitialFrameAudio) {
|
| }
|
|
|
| TEST_F(BothMixersTest, CompareSecondFrameAudio) {
|
| - EXPECT_CALL(participant_, GetAudioFrame(_, _)).Times(AtLeast(1));
|
| + EXPECT_CALL(participant_, GetAudioFrameWithMuted(_, _)).Times(Exactly(2));
|
|
|
| // Make sure the participant is marked as 'non-mixed' so that it is
|
| // ramped in next round.
|
|
|