Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red_unittest.cc

Issue 2411613002: Renaming AudioEncoder::SetTargetBitrate and SetProjectedPacketLossRate. (Closed)
Patch Set: rebasing Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket()) 90 EXPECT_CALL(*mock_encoder_, Num10MsFramesInNextPacket())
91 .WillOnce(Return(17U)); 91 .WillOnce(Return(17U));
92 EXPECT_EQ(17U, red_->Num10MsFramesInNextPacket()); 92 EXPECT_EQ(17U, red_->Num10MsFramesInNextPacket());
93 } 93 }
94 94
95 TEST_F(AudioEncoderCopyRedTest, CheckMaxFrameSizePropagation) { 95 TEST_F(AudioEncoderCopyRedTest, CheckMaxFrameSizePropagation) {
96 EXPECT_CALL(*mock_encoder_, Max10MsFramesInAPacket()).WillOnce(Return(17U)); 96 EXPECT_CALL(*mock_encoder_, Max10MsFramesInAPacket()).WillOnce(Return(17U));
97 EXPECT_EQ(17U, red_->Max10MsFramesInAPacket()); 97 EXPECT_EQ(17U, red_->Max10MsFramesInAPacket());
98 } 98 }
99 99
100 TEST_F(AudioEncoderCopyRedTest, CheckSetBitratePropagation) { 100 TEST_F(AudioEncoderCopyRedTest, CheckTargetAudioBitratePropagation) {
101 EXPECT_CALL(*mock_encoder_, SetTargetBitrate(4711)); 101 EXPECT_CALL(*mock_encoder_, OnReceivedTargetAudioBitrate(4711));
102 red_->SetTargetBitrate(4711); 102 red_->OnReceivedTargetAudioBitrate(4711);
103 } 103 }
104 104
105 TEST_F(AudioEncoderCopyRedTest, CheckProjectedPacketLossRatePropagation) { 105 TEST_F(AudioEncoderCopyRedTest, CheckPacketLossFractionPropagation) {
106 EXPECT_CALL(*mock_encoder_, SetProjectedPacketLossRate(0.5)); 106 EXPECT_CALL(*mock_encoder_, OnReceivedUplinkPacketLossFraction(0.5));
107 red_->SetProjectedPacketLossRate(0.5); 107 red_->OnReceivedUplinkPacketLossFraction(0.5);
108 } 108 }
109 109
110 // Checks that the an Encode() call is immediately propagated to the speech 110 // Checks that the an Encode() call is immediately propagated to the speech
111 // encoder. 111 // encoder.
112 TEST_F(AudioEncoderCopyRedTest, CheckImmediateEncode) { 112 TEST_F(AudioEncoderCopyRedTest, CheckImmediateEncode) {
113 // Interleaving the EXPECT_CALL sequence with expectations on the MockFunction 113 // Interleaving the EXPECT_CALL sequence with expectations on the MockFunction
114 // check ensures that exactly one call to EncodeImpl happens in each 114 // check ensures that exactly one call to EncodeImpl happens in each
115 // Encode call. 115 // Encode call.
116 InSequence s; 116 InSequence s;
117 MockFunction<void(int check_point_id)> check; 117 MockFunction<void(int check_point_id)> check;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 config.speech_encoder = NULL; 297 config.speech_encoder = NULL;
298 EXPECT_DEATH(red = new AudioEncoderCopyRed(std::move(config)), 298 EXPECT_DEATH(red = new AudioEncoderCopyRed(std::move(config)),
299 "Speech encoder not provided."); 299 "Speech encoder not provided.");
300 // The delete operation is needed to avoid leak reports from memcheck. 300 // The delete operation is needed to avoid leak reports from memcheck.
301 delete red; 301 delete red;
302 } 302 }
303 303
304 #endif // GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 304 #endif // GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
305 305
306 } // namespace webrtc 306 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698