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

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

Issue 2726853002: Small TransportFeedbackAdapterTest efficiency boost and TODO resolved (Closed)
Patch Set: Remove no longer relevant documentation. 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 for (size_t i = 0; i < len; ++i) { 92 for (size_t i = 0; i < len; ++i) {
93 EXPECT_EQ(truth[i].arrival_time_ms, 93 EXPECT_EQ(truth[i].arrival_time_ms,
94 input[i].arrival_time_ms + arrival_time_delta); 94 input[i].arrival_time_ms + arrival_time_delta);
95 EXPECT_EQ(truth[i].send_time_ms, input[i].send_time_ms); 95 EXPECT_EQ(truth[i].send_time_ms, input[i].send_time_ms);
96 EXPECT_EQ(truth[i].sequence_number, input[i].sequence_number); 96 EXPECT_EQ(truth[i].sequence_number, input[i].sequence_number);
97 EXPECT_EQ(truth[i].payload_size, input[i].payload_size); 97 EXPECT_EQ(truth[i].payload_size, input[i].payload_size);
98 EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info); 98 EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info);
99 } 99 }
100 } 100 }
101 101
102 // Utility method, to reset arrival_time_ms before adding send time. 102 void OnSentPacket(const PacketInfo& info) {
103 void OnSentPacket(PacketInfo info) {
104 info.arrival_time_ms = 0;
105 // TODO(philipel): Change -1, -1 to some values.
106 adapter_->AddPacket(info.sequence_number, info.payload_size, 103 adapter_->AddPacket(info.sequence_number, info.payload_size,
107 info.pacing_info); 104 info.pacing_info);
108 adapter_->OnSentPacket(info.sequence_number, info.send_time_ms); 105 adapter_->OnSentPacket(info.sequence_number, info.send_time_ms);
109 } 106 }
110 107
111 SimulatedClock clock_; 108 SimulatedClock clock_;
112 MockBitrateControllerAdapter bitrate_controller_; 109 MockBitrateControllerAdapter bitrate_controller_;
113 std::unique_ptr<TransportFeedbackAdapter> adapter_; 110 std::unique_ptr<TransportFeedbackAdapter> adapter_;
114 111
115 uint32_t target_bitrate_bps_; 112 uint32_t target_bitrate_bps_;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 EXPECT_TRUE(feedback.get() != nullptr); 444 EXPECT_TRUE(feedback.get() != nullptr);
448 adapter_->OnTransportFeedback(*feedback.get()); 445 adapter_->OnTransportFeedback(*feedback.get());
449 clock_.AdvanceTimeMilliseconds(50); 446 clock_.AdvanceTimeMilliseconds(50);
450 ++seq_num; 447 ++seq_num;
451 } 448 }
452 EXPECT_GT(target_bitrate_bps_, 0u); 449 EXPECT_GT(target_bitrate_bps_, 0u);
453 } 450 }
454 451
455 } // namespace test 452 } // namespace test
456 } // namespace webrtc 453 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698