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

Side by Side Diff: webrtc/voice_engine/transport_feedback_packet_loss_tracker_unittest.cc

Issue 2638083002: Attach TransportFeedbackPacketLossTracker to ANA (PLR only) (Closed)
Patch Set: Fix UT 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) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 constexpr int64_t kArrivalTimeMs = 1234; 79 constexpr int64_t kArrivalTimeMs = 1234;
80 80
81 std::vector<PacketFeedback> packet_feedback_vector; 81 std::vector<PacketFeedback> packet_feedback_vector;
82 uint16_t seq_num = base_sequence_num; 82 uint16_t seq_num = base_sequence_num;
83 for (bool received : reception_status_vec) { 83 for (bool received : reception_status_vec) {
84 packet_feedback_vector.emplace_back(PacketFeedback( 84 packet_feedback_vector.emplace_back(PacketFeedback(
85 received ? kArrivalTimeMs : PacketFeedback::kNotReceived, seq_num)); 85 received ? kArrivalTimeMs : PacketFeedback::kNotReceived, seq_num));
86 ++seq_num; 86 ++seq_num;
87 } 87 }
88 88
89 tracker->OnNewTransportFeedbackVector(packet_feedback_vector); 89 tracker->OnPacketFeedbackVector(packet_feedback_vector);
90 tracker->Validate(); 90 tracker->Validate();
91 } 91 }
92 92
93 // Checks that validty is as expected. If valid, checks also that 93 // Checks that validty is as expected. If valid, checks also that
94 // value is as expected. 94 // value is as expected.
95 void ValidatePacketLossStatistics( 95 void ValidatePacketLossStatistics(
96 const TransportFeedbackPacketLossTracker& tracker, 96 const TransportFeedbackPacketLossTracker& tracker,
97 rtc::Optional<float> expected_plr, 97 rtc::Optional<float> expected_plr,
98 rtc::Optional<float> expected_rplr) { 98 rtc::Optional<float> expected_rplr) {
99 // TODO(elad.alon): Comparing the rtc::Optional<float> directly would have 99 // TODO(elad.alon): Comparing the rtc::Optional<float> directly would have
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 591
592 // All tests are run multiple times with various baseline sequence number, 592 // All tests are run multiple times with various baseline sequence number,
593 // to weed out potential bugs with wrap-around handling. 593 // to weed out potential bugs with wrap-around handling.
594 constexpr uint16_t kBases[] = {0x0000, 0x3456, 0xc032, 0xfffe}; 594 constexpr uint16_t kBases[] = {0x0000, 0x3456, 0xc032, 0xfffe};
595 595
596 INSTANTIATE_TEST_CASE_P(_, 596 INSTANTIATE_TEST_CASE_P(_,
597 TransportFeedbackPacketLossTrackerTest, 597 TransportFeedbackPacketLossTrackerTest,
598 testing::ValuesIn(kBases)); 598 testing::ValuesIn(kBases));
599 599
600 } // namespace webrtc 600 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698