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

Side by Side Diff: webrtc/modules/congestion_controller/congestion_controller_unittests_helper.cc

Issue 2725823002: Move delay_based_bwe_ into CongestionController (Closed)
Patch Set: UT thread-checking. 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
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/modules/congestion_controller/congestion_controller_unittests_h elper.h"
12
13 #include "webrtc/base/checks.h"
14 #include "webrtc/test/gtest.h"
15
16 namespace webrtc {
17 void ComparePacketFeedbackVectors(const std::vector<PacketFeedback>& truth,
18 const std::vector<PacketFeedback>& input) {
19 ASSERT_EQ(truth.size(), input.size());
20 size_t len = truth.size();
21 // truth contains the input data for the test, and input is what will be
22 // sent to the bandwidth estimator. truth.arrival_tims_ms is used to
23 // populate the transport feedback messages. As these times may be changed
24 // (because of resolution limits in the packets, and because of the time
25 // base adjustment performed by the TransportFeedbackAdapter at the first
26 // packet, the truth[x].arrival_time and input[x].arrival_time may not be
27 // equal. However, the difference must be the same for all x.
28 int64_t arrival_time_delta =
29 truth[0].arrival_time_ms - input[0].arrival_time_ms;
30 for (size_t i = 0; i < len; ++i) {
31 RTC_CHECK(truth[i].arrival_time_ms != PacketFeedback::kNotReceived);
32 if (input[i].arrival_time_ms != PacketFeedback::kNotReceived) {
33 EXPECT_EQ(truth[i].arrival_time_ms,
34 input[i].arrival_time_ms + arrival_time_delta);
35 }
36 EXPECT_EQ(truth[i].send_time_ms, input[i].send_time_ms);
37 EXPECT_EQ(truth[i].sequence_number, input[i].sequence_number);
38 EXPECT_EQ(truth[i].payload_size, input[i].payload_size);
39 EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info);
40 }
41 }
42 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698