Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: webrtc/audio/audio_receive_stream_unittest.cc

Issue 2669153004: Remove remaining calls to VoE APIs from Audio[Send|Receive]Stream. (Closed)
Patch Set: fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 MockVoiceEngine& voice_engine() { return voice_engine_; } 136 MockVoiceEngine& voice_engine() { return voice_engine_; }
137 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } 137 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
138 138
139 void SetupMockForBweFeedback(bool send_side_bwe) { 139 void SetupMockForBweFeedback(bool send_side_bwe) {
140 EXPECT_CALL(remote_bitrate_estimator_, 140 EXPECT_CALL(remote_bitrate_estimator_,
141 RemoveStream(stream_config_.rtp.remote_ssrc)); 141 RemoveStream(stream_config_.rtp.remote_ssrc));
142 } 142 }
143 143
144 void SetupMockForGetStats() { 144 void SetupMockForGetStats() {
145 using testing::DoAll; 145 using testing::DoAll;
146 using testing::SetArgReferee; 146 using testing::SetArgPointee;
147 147
148 ASSERT_TRUE(channel_proxy_); 148 ASSERT_TRUE(channel_proxy_);
149 EXPECT_CALL(*channel_proxy_, GetRTCPStatistics()) 149 EXPECT_CALL(*channel_proxy_, GetRTCPStatistics())
150 .WillOnce(Return(kCallStats)); 150 .WillOnce(Return(kCallStats));
151 EXPECT_CALL(*channel_proxy_, GetDelayEstimate()) 151 EXPECT_CALL(*channel_proxy_, GetDelayEstimate())
152 .WillOnce(Return(kJitterBufferDelay + kPlayoutBufferDelay)); 152 .WillOnce(Return(kJitterBufferDelay + kPlayoutBufferDelay));
153 EXPECT_CALL(*channel_proxy_, GetSpeechOutputLevelFullRange()) 153 EXPECT_CALL(*channel_proxy_, GetSpeechOutputLevelFullRange())
154 .WillOnce(Return(kSpeechOutputLevel)); 154 .WillOnce(Return(kSpeechOutputLevel));
155 EXPECT_CALL(*channel_proxy_, GetNetworkStatistics()) 155 EXPECT_CALL(*channel_proxy_, GetNetworkStatistics())
156 .WillOnce(Return(kNetworkStats)); 156 .WillOnce(Return(kNetworkStats));
157 EXPECT_CALL(*channel_proxy_, GetDecodingCallStatistics()) 157 EXPECT_CALL(*channel_proxy_, GetDecodingCallStatistics())
158 .WillOnce(Return(kAudioDecodeStats)); 158 .WillOnce(Return(kAudioDecodeStats));
159 159 EXPECT_CALL(*channel_proxy_, GetRecCodec(_))
160 EXPECT_CALL(voice_engine_, GetRecCodec(kChannelId, _)) 160 .WillOnce(DoAll(SetArgPointee<0>(kCodecInst), Return(true)));
161 .WillOnce(DoAll(SetArgReferee<1>(kCodecInst), Return(0)));
162 } 161 }
163 162
164 private: 163 private:
165 PacketRouter packet_router_; 164 PacketRouter packet_router_;
166 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; 165 rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
167 MockRemoteBitrateEstimator remote_bitrate_estimator_; 166 MockRemoteBitrateEstimator remote_bitrate_estimator_;
168 MockRtcEventLog event_log_; 167 MockRtcEventLog event_log_;
169 testing::StrictMock<MockVoiceEngine> voice_engine_; 168 testing::StrictMock<MockVoiceEngine> voice_engine_;
170 rtc::scoped_refptr<AudioState> audio_state_; 169 rtc::scoped_refptr<AudioState> audio_state_;
171 rtc::scoped_refptr<MockAudioMixer> audio_mixer_; 170 rtc::scoped_refptr<MockAudioMixer> audio_mixer_;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 379
381 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0)); 380 EXPECT_CALL(helper.voice_engine(), StartPlayout(_)).WillOnce(Return(0));
382 EXPECT_CALL(helper.voice_engine(), StopPlayout(_)); 381 EXPECT_CALL(helper.voice_engine(), StopPlayout(_));
383 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream)) 382 EXPECT_CALL(*helper.audio_mixer(), AddSource(&recv_stream))
384 .WillOnce(Return(true)); 383 .WillOnce(Return(true));
385 384
386 recv_stream.Start(); 385 recv_stream.Start();
387 } 386 }
388 } // namespace test 387 } // namespace test
389 } // namespace webrtc 388 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698