Chromium Code Reviews| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); | 63 RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); |
| 64 EXPECT_CALL(voice_engine_, | 64 EXPECT_CALL(voice_engine_, |
| 65 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); | 65 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); |
| 66 AudioState::Config config; | 66 AudioState::Config config; |
| 67 config.voice_engine = &voice_engine_; | 67 config.voice_engine = &voice_engine_; |
| 68 audio_state_ = AudioState::Create(config); | 68 audio_state_ = AudioState::Create(config); |
| 69 | 69 |
| 70 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) | 70 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) |
| 71 .WillOnce(Invoke([this](int channel_id) { | 71 .WillOnce(Invoke([this](int channel_id) { |
| 72 EXPECT_FALSE(channel_proxy_); | 72 EXPECT_FALSE(channel_proxy_); |
| 73 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); | 73 channel_proxy_ = new testing::NiceMock<MockVoEChannelProxy>(); |
| 74 EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1); | 74 EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1); |
| 75 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1); | 75 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1); |
| 76 EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1); | 76 EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1); |
| 77 EXPECT_CALL(*channel_proxy_, | 77 EXPECT_CALL(*channel_proxy_, |
| 78 SetSendAbsoluteSenderTimeStatus(true, kAbsSendTimeId)).Times(1); | 78 SetSendAbsoluteSenderTimeStatus(true, kAbsSendTimeId)).Times(1); |
| 79 EXPECT_CALL(*channel_proxy_, | 79 EXPECT_CALL(*channel_proxy_, |
| 80 SetSendAudioLevelIndicationStatus(true, kAudioLevelId)).Times(1); | 80 SetSendAudioLevelIndicationStatus(true, kAudioLevelId)).Times(1); |
| 81 EXPECT_CALL(*channel_proxy_, EnableSendTransportSequenceNumber( | 81 EXPECT_CALL(*channel_proxy_, EnableSendTransportSequenceNumber( |
| 82 kTransportSequenceNumberId)) | 82 kTransportSequenceNumberId)) |
| 83 .Times(1); | 83 .Times(1); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 EXPECT_CALL(voice_engine_, GetEcDelayMetrics(_, _, _)) | 149 EXPECT_CALL(voice_engine_, GetEcDelayMetrics(_, _, _)) |
| 150 .WillRepeatedly(DoAll(SetArgReferee<0>(kEchoDelayMedian), | 150 .WillRepeatedly(DoAll(SetArgReferee<0>(kEchoDelayMedian), |
| 151 SetArgReferee<1>(kEchoDelayStdDev), Return(0))); | 151 SetArgReferee<1>(kEchoDelayStdDev), Return(0))); |
| 152 } | 152 } |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 SimulatedClock simulated_clock_; | 155 SimulatedClock simulated_clock_; |
| 156 testing::StrictMock<MockVoiceEngine> voice_engine_; | 156 testing::StrictMock<MockVoiceEngine> voice_engine_; |
| 157 rtc::scoped_refptr<AudioState> audio_state_; | 157 rtc::scoped_refptr<AudioState> audio_state_; |
| 158 AudioSendStream::Config stream_config_; | 158 AudioSendStream::Config stream_config_; |
| 159 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; | 159 testing::NiceMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; |
|
mflodman
2016/04/22 09:02:19
To avoid errors for unnecessary calls to DeRegiste
| |
| 160 testing::NiceMock<MockBitrateObserver> bitrate_observer_; | 160 testing::NiceMock<MockBitrateObserver> bitrate_observer_; |
| 161 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; | 161 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; |
| 162 CongestionController congestion_controller_; | 162 CongestionController congestion_controller_; |
| 163 }; | 163 }; |
| 164 } // namespace | 164 } // namespace |
| 165 | 165 |
| 166 TEST(AudioSendStreamTest, ConfigToString) { | 166 TEST(AudioSendStreamTest, ConfigToString) { |
| 167 AudioSendStream::Config config(nullptr); | 167 AudioSendStream::Config config(nullptr); |
| 168 config.rtp.ssrc = kSsrc; | 168 config.rtp.ssrc = kSsrc; |
| 169 config.rtp.extensions.push_back( | 169 config.rtp.extensions.push_back( |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 static_cast<internal::AudioState*>(helper.audio_state().get()); | 234 static_cast<internal::AudioState*>(helper.audio_state().get()); |
| 235 VoiceEngineObserver* voe_observer = | 235 VoiceEngineObserver* voe_observer = |
| 236 static_cast<VoiceEngineObserver*>(internal_audio_state); | 236 static_cast<VoiceEngineObserver*>(internal_audio_state); |
| 237 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); | 237 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); |
| 238 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); | 238 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); |
| 239 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); | 239 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); |
| 240 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); | 240 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); |
| 241 } | 241 } |
| 242 } // namespace test | 242 } // namespace test |
| 243 } // namespace webrtc | 243 } // namespace webrtc |
| OLD | NEW |