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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 stream_config_.rtp.extensions.push_back( | 103 stream_config_.rtp.extensions.push_back( |
104 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); | 104 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); |
105 stream_config_.rtp.extensions.push_back( | 105 stream_config_.rtp.extensions.push_back( |
106 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); | 106 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); |
107 stream_config_.rtp.extensions.push_back(RtpExtension( | 107 stream_config_.rtp.extensions.push_back(RtpExtension( |
108 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); | 108 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); |
109 } | 109 } |
110 | 110 |
111 AudioSendStream::Config& config() { return stream_config_; } | 111 AudioSendStream::Config& config() { return stream_config_; } |
112 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } | 112 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } |
| 113 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } |
113 CongestionController* congestion_controller() { | 114 CongestionController* congestion_controller() { |
114 return &congestion_controller_; | 115 return &congestion_controller_; |
115 } | 116 } |
116 | 117 |
117 void SetupMockForSendTelephoneEvent() { | 118 void SetupMockForSendTelephoneEvent() { |
118 EXPECT_TRUE(channel_proxy_); | 119 EXPECT_TRUE(channel_proxy_); |
119 EXPECT_CALL(*channel_proxy_, | 120 EXPECT_CALL(*channel_proxy_, |
120 SetSendTelephoneEventPayloadType(kTelephoneEventPayloadType)) | 121 SetSendTelephoneEventPayloadType(kTelephoneEventPayloadType)) |
121 .WillOnce(Return(true)); | 122 .WillOnce(Return(true)); |
122 EXPECT_CALL(*channel_proxy_, | 123 EXPECT_CALL(*channel_proxy_, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 TEST(AudioSendStreamTest, SendTelephoneEvent) { | 195 TEST(AudioSendStreamTest, SendTelephoneEvent) { |
195 ConfigHelper helper; | 196 ConfigHelper helper; |
196 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), | 197 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), |
197 helper.congestion_controller()); | 198 helper.congestion_controller()); |
198 helper.SetupMockForSendTelephoneEvent(); | 199 helper.SetupMockForSendTelephoneEvent(); |
199 EXPECT_TRUE(send_stream.SendTelephoneEvent(kTelephoneEventPayloadType, | 200 EXPECT_TRUE(send_stream.SendTelephoneEvent(kTelephoneEventPayloadType, |
200 kTelephoneEventCode, kTelephoneEventDuration)); | 201 kTelephoneEventCode, kTelephoneEventDuration)); |
201 } | 202 } |
202 | 203 |
| 204 TEST(AudioSendStreamTest, SetMuted) { |
| 205 ConfigHelper helper; |
| 206 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), |
| 207 helper.congestion_controller()); |
| 208 EXPECT_CALL(*helper.channel_proxy(), SetInputMute(true)); |
| 209 send_stream.SetMuted(true); |
| 210 } |
| 211 |
203 TEST(AudioSendStreamTest, GetStats) { | 212 TEST(AudioSendStreamTest, GetStats) { |
204 ConfigHelper helper; | 213 ConfigHelper helper; |
205 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), | 214 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), |
206 helper.congestion_controller()); | 215 helper.congestion_controller()); |
207 helper.SetupMockForGetStats(); | 216 helper.SetupMockForGetStats(); |
208 AudioSendStream::Stats stats = send_stream.GetStats(); | 217 AudioSendStream::Stats stats = send_stream.GetStats(); |
209 EXPECT_EQ(kSsrc, stats.local_ssrc); | 218 EXPECT_EQ(kSsrc, stats.local_ssrc); |
210 EXPECT_EQ(static_cast<int64_t>(kCallStats.bytesSent), stats.bytes_sent); | 219 EXPECT_EQ(static_cast<int64_t>(kCallStats.bytesSent), stats.bytes_sent); |
211 EXPECT_EQ(kCallStats.packetsSent, stats.packets_sent); | 220 EXPECT_EQ(kCallStats.packetsSent, stats.packets_sent); |
212 EXPECT_EQ(static_cast<int32_t>(kReportBlock.cumulative_num_packets_lost), | 221 EXPECT_EQ(static_cast<int32_t>(kReportBlock.cumulative_num_packets_lost), |
(...skipping 26 matching lines...) Expand all Loading... |
239 static_cast<internal::AudioState*>(helper.audio_state().get()); | 248 static_cast<internal::AudioState*>(helper.audio_state().get()); |
240 VoiceEngineObserver* voe_observer = | 249 VoiceEngineObserver* voe_observer = |
241 static_cast<VoiceEngineObserver*>(internal_audio_state); | 250 static_cast<VoiceEngineObserver*>(internal_audio_state); |
242 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); | 251 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); |
243 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); | 252 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); |
244 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); | 253 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); |
245 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); | 254 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); |
246 } | 255 } |
247 } // namespace test | 256 } // namespace test |
248 } // namespace webrtc | 257 } // namespace webrtc |
OLD | NEW |