| 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 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 #include "webrtc/audio/audio_send_stream.h" | 16 #include "webrtc/audio/audio_send_stream.h" |
| 17 #include "webrtc/audio/audio_state.h" | 17 #include "webrtc/audio/audio_state.h" |
| 18 #include "webrtc/audio/conversion.h" | 18 #include "webrtc/audio/conversion.h" |
| 19 #include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller
.h" | 19 #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_cont
roller.h" |
| 20 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | 20 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |
| 21 #include "webrtc/modules/pacing/paced_sender.h" | 21 #include "webrtc/modules/pacing/paced_sender.h" |
| 22 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra
te_estimator.h" | 22 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra
te_estimator.h" |
| 23 #include "webrtc/test/mock_voe_channel_proxy.h" | 23 #include "webrtc/test/mock_voe_channel_proxy.h" |
| 24 #include "webrtc/test/mock_voice_engine.h" | 24 #include "webrtc/test/mock_voice_engine.h" |
| 25 | 25 |
| 26 namespace webrtc { | 26 namespace webrtc { |
| 27 namespace test { | 27 namespace test { |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 .WillRepeatedly(DoAll(SetArgReferee<0>(kEchoDelayMedian), | 154 .WillRepeatedly(DoAll(SetArgReferee<0>(kEchoDelayMedian), |
| 155 SetArgReferee<1>(kEchoDelayStdDev), Return(0))); | 155 SetArgReferee<1>(kEchoDelayStdDev), Return(0))); |
| 156 } | 156 } |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 SimulatedClock simulated_clock_; | 159 SimulatedClock simulated_clock_; |
| 160 testing::StrictMock<MockVoiceEngine> voice_engine_; | 160 testing::StrictMock<MockVoiceEngine> voice_engine_; |
| 161 rtc::scoped_refptr<AudioState> audio_state_; | 161 rtc::scoped_refptr<AudioState> audio_state_; |
| 162 AudioSendStream::Config stream_config_; | 162 AudioSendStream::Config stream_config_; |
| 163 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; | 163 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; |
| 164 testing::NiceMock<MockBitrateObserver> bitrate_observer_; | 164 testing::NiceMock<MockCongestionObserver> bitrate_observer_; |
| 165 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; | 165 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; |
| 166 CongestionController congestion_controller_; | 166 CongestionController congestion_controller_; |
| 167 }; | 167 }; |
| 168 } // namespace | 168 } // namespace |
| 169 | 169 |
| 170 TEST(AudioSendStreamTest, ConfigToString) { | 170 TEST(AudioSendStreamTest, ConfigToString) { |
| 171 AudioSendStream::Config config(nullptr); | 171 AudioSendStream::Config config(nullptr); |
| 172 config.rtp.ssrc = kSsrc; | 172 config.rtp.ssrc = kSsrc; |
| 173 config.rtp.extensions.push_back( | 173 config.rtp.extensions.push_back( |
| 174 RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeId)); | 174 RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeId)); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 static_cast<internal::AudioState*>(helper.audio_state().get()); | 238 static_cast<internal::AudioState*>(helper.audio_state().get()); |
| 239 VoiceEngineObserver* voe_observer = | 239 VoiceEngineObserver* voe_observer = |
| 240 static_cast<VoiceEngineObserver*>(internal_audio_state); | 240 static_cast<VoiceEngineObserver*>(internal_audio_state); |
| 241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); | 241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); |
| 242 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); | 242 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); |
| 243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); | 243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); |
| 244 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); | 244 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); |
| 245 } | 245 } |
| 246 } // namespace test | 246 } // namespace test |
| 247 } // namespace webrtc | 247 } // namespace webrtc |
| OLD | NEW |