| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 CreateCng(MakeCngConfig()); | 210 CreateCng(MakeCngConfig()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 TEST_F(AudioEncoderCngTest, CheckFrameSizePropagation) { | 213 TEST_F(AudioEncoderCngTest, CheckFrameSizePropagation) { |
| 214 CreateCng(MakeCngConfig()); | 214 CreateCng(MakeCngConfig()); |
| 215 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) | 215 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) |
| 216 .WillOnce(Return(17U)); | 216 .WillOnce(Return(17U)); |
| 217 EXPECT_EQ(17U, cng_->Num10MsFramesInNextPacket()); | 217 EXPECT_EQ(17U, cng_->Num10MsFramesInNextPacket()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 TEST_F(AudioEncoderCngTest, CheckTargetAudioBitratePropagation) { | 220 TEST_F(AudioEncoderCngTest, CheckChangeBitratePropagation) { |
| 221 CreateCng(MakeCngConfig()); | 221 CreateCng(MakeCngConfig()); |
| 222 EXPECT_CALL(*mock_encoder_, OnReceivedTargetAudioBitrate(4711)); | 222 EXPECT_CALL(*mock_encoder_, SetTargetBitrate(4711)); |
| 223 cng_->OnReceivedTargetAudioBitrate(4711); | 223 cng_->SetTargetBitrate(4711); |
| 224 } | 224 } |
| 225 | 225 |
| 226 TEST_F(AudioEncoderCngTest, CheckPacketLossFractionPropagation) { | 226 TEST_F(AudioEncoderCngTest, CheckProjectedPacketLossRatePropagation) { |
| 227 CreateCng(MakeCngConfig()); | 227 CreateCng(MakeCngConfig()); |
| 228 EXPECT_CALL(*mock_encoder_, OnReceivedUplinkPacketLossFraction(0.5)); | 228 EXPECT_CALL(*mock_encoder_, SetProjectedPacketLossRate(0.5)); |
| 229 cng_->OnReceivedUplinkPacketLossFraction(0.5); | 229 cng_->SetProjectedPacketLossRate(0.5); |
| 230 } | 230 } |
| 231 | 231 |
| 232 TEST_F(AudioEncoderCngTest, EncodeCallsVad) { | 232 TEST_F(AudioEncoderCngTest, EncodeCallsVad) { |
| 233 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) | 233 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) |
| 234 .WillRepeatedly(Return(1U)); | 234 .WillRepeatedly(Return(1U)); |
| 235 CreateCng(MakeCngConfig()); | 235 CreateCng(MakeCngConfig()); |
| 236 EXPECT_CALL(*mock_vad_, VoiceActivity(_, _, _)) | 236 EXPECT_CALL(*mock_vad_, VoiceActivity(_, _, _)) |
| 237 .WillOnce(Return(Vad::kPassive)); | 237 .WillOnce(Return(Vad::kPassive)); |
| 238 Encode(); | 238 Encode(); |
| 239 } | 239 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 .WillRepeatedly(Return(7U)); | 496 .WillRepeatedly(Return(7U)); |
| 497 for (int i = 0; i < 6; ++i) | 497 for (int i = 0; i < 6; ++i) |
| 498 Encode(); | 498 Encode(); |
| 499 EXPECT_DEATH(Encode(), | 499 EXPECT_DEATH(Encode(), |
| 500 "Frame size cannot be larger than 60 ms when using VAD/CNG."); | 500 "Frame size cannot be larger than 60 ms when using VAD/CNG."); |
| 501 } | 501 } |
| 502 | 502 |
| 503 #endif // GTEST_HAS_DEATH_TEST | 503 #endif // GTEST_HAS_DEATH_TEST |
| 504 | 504 |
| 505 } // namespace webrtc | 505 } // namespace webrtc |
| OLD | NEW |