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

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

Issue 2746333009: OnReceivedUplinkPacketLossFraction() receives [const rtc::Optional<float>&] (Closed)
Patch Set: Rebased Created 3 years, 9 months 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 EXPECT_EQ(17U, red_->Max10MsFramesInAPacket()); 97 EXPECT_EQ(17U, red_->Max10MsFramesInAPacket());
98 } 98 }
99 99
100 TEST_F(AudioEncoderCopyRedTest, CheckTargetAudioBitratePropagation) { 100 TEST_F(AudioEncoderCopyRedTest, CheckTargetAudioBitratePropagation) {
101 EXPECT_CALL(*mock_encoder_, 101 EXPECT_CALL(*mock_encoder_,
102 OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>())); 102 OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>()));
103 red_->OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>()); 103 red_->OnReceivedUplinkBandwidth(4711, rtc::Optional<int64_t>());
104 } 104 }
105 105
106 TEST_F(AudioEncoderCopyRedTest, CheckPacketLossFractionPropagation) { 106 TEST_F(AudioEncoderCopyRedTest, CheckPacketLossFractionPropagation) {
107 EXPECT_CALL(*mock_encoder_, OnReceivedUplinkPacketLossFraction(0.5)); 107 EXPECT_CALL(*mock_encoder_,
108 red_->OnReceivedUplinkPacketLossFraction(0.5); 108 OnReceivedUplinkPacketLossFraction(rtc::Optional<float>(0.5f)));
109 red_->OnReceivedUplinkPacketLossFraction(rtc::Optional<float>(0.5f));
109 } 110 }
110 111
111 // Checks that the an Encode() call is immediately propagated to the speech 112 // Checks that the an Encode() call is immediately propagated to the speech
112 // encoder. 113 // encoder.
113 TEST_F(AudioEncoderCopyRedTest, CheckImmediateEncode) { 114 TEST_F(AudioEncoderCopyRedTest, CheckImmediateEncode) {
114 // Interleaving the EXPECT_CALL sequence with expectations on the MockFunction 115 // Interleaving the EXPECT_CALL sequence with expectations on the MockFunction
115 // check ensures that exactly one call to EncodeImpl happens in each 116 // check ensures that exactly one call to EncodeImpl happens in each
116 // Encode call. 117 // Encode call.
117 InSequence s; 118 InSequence s;
118 MockFunction<void(int check_point_id)> check; 119 MockFunction<void(int check_point_id)> check;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 config.speech_encoder = NULL; 299 config.speech_encoder = NULL;
299 EXPECT_DEATH(red = new AudioEncoderCopyRed(std::move(config)), 300 EXPECT_DEATH(red = new AudioEncoderCopyRed(std::move(config)),
300 "Speech encoder not provided."); 301 "Speech encoder not provided.");
301 // The delete operation is needed to avoid leak reports from memcheck. 302 // The delete operation is needed to avoid leak reports from memcheck.
302 delete red; 303 delete red;
303 } 304 }
304 305
305 #endif // GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 306 #endif // GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
306 307
307 } // namespace webrtc 308 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc ('k') | webrtc/tools/event_log_visualizer/analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698