OLD | NEW |
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 MockCongestionController* congestion_controller() { | 114 MockCongestionController* congestion_controller() { |
115 return &congestion_controller_; | 115 return &congestion_controller_; |
116 } | 116 } |
117 MockRemoteBitrateEstimator* remote_bitrate_estimator() { | 117 MockRemoteBitrateEstimator* remote_bitrate_estimator() { |
118 return &remote_bitrate_estimator_; | 118 return &remote_bitrate_estimator_; |
119 } | 119 } |
120 AudioReceiveStream::Config& config() { return stream_config_; } | 120 AudioReceiveStream::Config& config() { return stream_config_; } |
121 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } | 121 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } |
122 MockVoiceEngine& voice_engine() { return voice_engine_; } | 122 MockVoiceEngine& voice_engine() { return voice_engine_; } |
| 123 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } |
123 | 124 |
124 void SetupMockForBweFeedback(bool send_side_bwe) { | 125 void SetupMockForBweFeedback(bool send_side_bwe) { |
125 EXPECT_CALL(congestion_controller_, | 126 EXPECT_CALL(congestion_controller_, |
126 GetRemoteBitrateEstimator(send_side_bwe)) | 127 GetRemoteBitrateEstimator(send_side_bwe)) |
127 .WillOnce(Return(&remote_bitrate_estimator_)); | 128 .WillOnce(Return(&remote_bitrate_estimator_)); |
128 EXPECT_CALL(remote_bitrate_estimator_, | 129 EXPECT_CALL(remote_bitrate_estimator_, |
129 RemoveStream(stream_config_.rtp.remote_ssrc)); | 130 RemoveStream(stream_config_.rtp.remote_ssrc)); |
130 } | 131 } |
131 | 132 |
132 void SetupMockForGetStats() { | 133 void SetupMockForGetStats() { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 PacketTime packet_time(5678000, 0); | 248 PacketTime packet_time(5678000, 0); |
248 const size_t kExpectedHeaderLength = 20; | 249 const size_t kExpectedHeaderLength = 20; |
249 RTPHeaderExtension expected_extension; | 250 RTPHeaderExtension expected_extension; |
250 expected_extension.hasTransportSequenceNumber = true; | 251 expected_extension.hasTransportSequenceNumber = true; |
251 expected_extension.transportSequenceNumber = kTransportSequenceNumberValue; | 252 expected_extension.transportSequenceNumber = kTransportSequenceNumberValue; |
252 EXPECT_CALL(*helper.remote_bitrate_estimator(), | 253 EXPECT_CALL(*helper.remote_bitrate_estimator(), |
253 IncomingPacket(packet_time.timestamp / 1000, | 254 IncomingPacket(packet_time.timestamp / 1000, |
254 rtp_packet.size() - kExpectedHeaderLength, | 255 rtp_packet.size() - kExpectedHeaderLength, |
255 VerifyHeaderExtension(expected_extension), false)) | 256 VerifyHeaderExtension(expected_extension), false)) |
256 .Times(1); | 257 .Times(1); |
| 258 EXPECT_CALL(*helper.channel_proxy(), |
| 259 ReceivedRTPPacket(&rtp_packet[0], |
| 260 rtp_packet.size(), |
| 261 _)) |
| 262 .WillOnce(Return(true)); |
257 EXPECT_TRUE( | 263 EXPECT_TRUE( |
258 recv_stream.DeliverRtp(&rtp_packet[0], rtp_packet.size(), packet_time)); | 264 recv_stream.DeliverRtp(&rtp_packet[0], rtp_packet.size(), packet_time)); |
259 } | 265 } |
260 | 266 |
261 TEST(AudioReceiveStreamTest, GetStats) { | 267 TEST(AudioReceiveStreamTest, GetStats) { |
262 ConfigHelper helper; | 268 ConfigHelper helper; |
263 internal::AudioReceiveStream recv_stream( | 269 internal::AudioReceiveStream recv_stream( |
264 helper.congestion_controller(), helper.config(), helper.audio_state()); | 270 helper.congestion_controller(), helper.config(), helper.audio_state()); |
265 helper.SetupMockForGetStats(); | 271 helper.SetupMockForGetStats(); |
266 AudioReceiveStream::Stats stats = recv_stream.GetStats(); | 272 AudioReceiveStream::Stats stats = recv_stream.GetStats(); |
(...skipping 27 matching lines...) Expand all Loading... |
294 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); | 300 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); |
295 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal); | 301 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal); |
296 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc); | 302 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc); |
297 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng); | 303 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng); |
298 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng); | 304 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng); |
299 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_, | 305 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_, |
300 stats.capture_start_ntp_time_ms); | 306 stats.capture_start_ntp_time_ms); |
301 } | 307 } |
302 } // namespace test | 308 } // namespace test |
303 } // namespace webrtc | 309 } // namespace webrtc |
OLD | NEW |