| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 TEST_F(AudioEncoderCngTest, CheckTargetAudioBitratePropagation) { | 220 TEST_F(AudioEncoderCngTest, CheckTargetAudioBitratePropagation) { |
| 221 CreateCng(MakeCngConfig()); | 221 CreateCng(MakeCngConfig()); |
| 222 EXPECT_CALL(*mock_encoder_, | 222 EXPECT_CALL(*mock_encoder_, |
| 223 OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>())); | 223 OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>())); |
| 224 cng_->OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>()); | 224 cng_->OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>()); |
| 225 } | 225 } |
| 226 | 226 |
| 227 TEST_F(AudioEncoderCngTest, CheckPacketLossFractionPropagation) { | 227 TEST_F(AudioEncoderCngTest, CheckPacketLossFractionPropagation) { |
| 228 CreateCng(MakeCngConfig()); | 228 CreateCng(MakeCngConfig()); |
| 229 EXPECT_CALL(*mock_encoder_, OnReceivedUplinkPacketLossFraction(0.5)); | 229 EXPECT_CALL(*mock_encoder_, |
| 230 cng_->OnReceivedUplinkPacketLossFraction(0.5); | 230 OnReceivedUplinkPacketLossFraction(rtc::Optional<float>(0.5f))); |
| 231 cng_->OnReceivedUplinkPacketLossFraction(rtc::Optional<float>(0.5f)); |
| 231 } | 232 } |
| 232 | 233 |
| 233 TEST_F(AudioEncoderCngTest, EncodeCallsVad) { | 234 TEST_F(AudioEncoderCngTest, EncodeCallsVad) { |
| 234 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) | 235 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) |
| 235 .WillRepeatedly(Return(1U)); | 236 .WillRepeatedly(Return(1U)); |
| 236 CreateCng(MakeCngConfig()); | 237 CreateCng(MakeCngConfig()); |
| 237 EXPECT_CALL(*mock_vad_, VoiceActivity(_, _, _)) | 238 EXPECT_CALL(*mock_vad_, VoiceActivity(_, _, _)) |
| 238 .WillOnce(Return(Vad::kPassive)); | 239 .WillOnce(Return(Vad::kPassive)); |
| 239 Encode(); | 240 Encode(); |
| 240 } | 241 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 .WillRepeatedly(Return(7U)); | 498 .WillRepeatedly(Return(7U)); |
| 498 for (int i = 0; i < 6; ++i) | 499 for (int i = 0; i < 6; ++i) |
| 499 Encode(); | 500 Encode(); |
| 500 EXPECT_DEATH(Encode(), | 501 EXPECT_DEATH(Encode(), |
| 501 "Frame size cannot be larger than 60 ms when using VAD/CNG."); | 502 "Frame size cannot be larger than 60 ms when using VAD/CNG."); |
| 502 } | 503 } |
| 503 | 504 |
| 504 #endif // GTEST_HAS_DEATH_TEST | 505 #endif // GTEST_HAS_DEATH_TEST |
| 505 | 506 |
| 506 } // namespace webrtc | 507 } // namespace webrtc |
| OLD | NEW |