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

Unified Diff: webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc

Issue 2708873003: Propagate packet pacing information to SendTimeHistory. (Closed)
Patch Set: . Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc
diff --git a/webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc b/webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc
index f4589c2a49b352578d08c0d2fb8425ee4e96dba6..65ba84799bfddd2f088ed9628c914d14af43c6cf 100644
--- a/webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc
+++ b/webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc
@@ -26,6 +26,15 @@ using ::testing::_;
using ::testing::Invoke;
namespace webrtc {
+
+namespace {
+const PacedPacketInfo kPacingInfo0(0, 5, 2000);
+const PacedPacketInfo kPacingInfo1(1, 8, 4000);
+const PacedPacketInfo kPacingInfo2(2, 14, 7000);
+const PacedPacketInfo kPacingInfo3(3, 20, 10000);
+const PacedPacketInfo kPacingInfo4(4, 22, 10000);
+}
+
namespace test {
class TransportFeedbackAdapterTest : public ::testing::Test {
@@ -86,15 +95,16 @@ class TransportFeedbackAdapterTest : public ::testing::Test {
EXPECT_EQ(truth[i].send_time_ms, input[i].send_time_ms);
EXPECT_EQ(truth[i].sequence_number, input[i].sequence_number);
EXPECT_EQ(truth[i].payload_size, input[i].payload_size);
- EXPECT_EQ(truth[i].probe_cluster_id, input[i].probe_cluster_id);
+ EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info);
}
}
// Utility method, to reset arrival_time_ms before adding send time.
void OnSentPacket(PacketInfo info) {
info.arrival_time_ms = 0;
+ // TODO(philipel): Change -1, -1 to some values.
adapter_->AddPacket(info.sequence_number, info.payload_size,
- info.probe_cluster_id);
+ info.pacing_info);
adapter_->OnSentPacket(info.sequence_number, info.send_time_ms);
}
@@ -107,11 +117,11 @@ class TransportFeedbackAdapterTest : public ::testing::Test {
TEST_F(TransportFeedbackAdapterTest, AdaptsFeedbackAndPopulatesSendTimes) {
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(100, 200, 0, 1500, 0));
- packets.push_back(PacketInfo(110, 210, 1, 1500, 0));
- packets.push_back(PacketInfo(120, 220, 2, 1500, 0));
- packets.push_back(PacketInfo(130, 230, 3, 1500, 1));
- packets.push_back(PacketInfo(140, 240, 4, 1500, 1));
+ packets.push_back(PacketInfo(100, 200, 0, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(110, 210, 1, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(120, 220, 2, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(130, 230, 3, 1500, kPacingInfo1));
+ packets.push_back(PacketInfo(140, 240, 4, 1500, kPacingInfo1));
for (const PacketInfo& packet : packets)
OnSentPacket(packet);
@@ -136,11 +146,15 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
const int kMaxConsecutiveFailedLookups = 5;
for (int i = 0; i < kMaxConsecutiveFailedLookups; ++i) {
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(i * 100, 2 * i * 100, 0, 1500, 0));
- packets.push_back(PacketInfo(i * 100 + 10, 2 * i * 100 + 10, 1, 1500, 0));
- packets.push_back(PacketInfo(i * 100 + 20, 2 * i * 100 + 20, 2, 1500, 0));
- packets.push_back(PacketInfo(i * 100 + 30, 2 * i * 100 + 30, 3, 1500, 1));
- packets.push_back(PacketInfo(i * 100 + 40, 2 * i * 100 + 40, 4, 1500, 1));
+ packets.push_back(PacketInfo(i * 100, 2 * i * 100, 0, 1500, kPacingInfo0));
+ packets.push_back(
+ PacketInfo(i * 100 + 10, 2 * i * 100 + 10, 1, 1500, kPacingInfo0));
+ packets.push_back(
+ PacketInfo(i * 100 + 20, 2 * i * 100 + 20, 2, 1500, kPacingInfo0));
+ packets.push_back(
+ PacketInfo(i * 100 + 30, 2 * i * 100 + 30, 3, 1500, kPacingInfo1));
+ packets.push_back(
+ PacketInfo(i * 100 + 40, 2 * i * 100 + 40, 4, 1500, kPacingInfo1));
for (const PacketInfo& packet : packets)
OnSentPacket(packet);
@@ -158,7 +172,8 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
clock_.AdvanceTimeMilliseconds(kFeedbackTimeoutMs);
PacketInfo later_packet(kFeedbackTimeoutMs + i * 100 + 40,
- kFeedbackTimeoutMs + i * 200 + 40, 5, 1500, 1);
+ kFeedbackTimeoutMs + i * 200 + 40, 5, 1500,
+ kPacingInfo1);
OnSentPacket(later_packet);
adapter_->OnTransportFeedback(feedback);
@@ -167,7 +182,6 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
for (PacketInfo& packet : packets) {
packet.send_time_ms = -1;
packet.payload_size = 0;
- packet.probe_cluster_id = -1;
}
ComparePacketVectors(packets, adapter_->GetTransportFeedbackVector());
}
@@ -178,11 +192,11 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
// Test with feedback that isn't late enough to time out.
{
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(100, 200, 0, 1500, 0));
- packets.push_back(PacketInfo(110, 210, 1, 1500, 0));
- packets.push_back(PacketInfo(120, 220, 2, 1500, 0));
- packets.push_back(PacketInfo(130, 230, 3, 1500, 1));
- packets.push_back(PacketInfo(140, 240, 4, 1500, 1));
+ packets.push_back(PacketInfo(100, 200, 0, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(110, 210, 1, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(120, 220, 2, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(130, 230, 3, 1500, kPacingInfo1));
+ packets.push_back(PacketInfo(140, 240, 4, 1500, kPacingInfo1));
for (const PacketInfo& packet : packets)
OnSentPacket(packet);
@@ -200,7 +214,7 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
clock_.AdvanceTimeMilliseconds(kFeedbackTimeoutMs - 1);
PacketInfo later_packet(kFeedbackTimeoutMs + 140, kFeedbackTimeoutMs + 240,
- 5, 1500, 1);
+ 5, 1500, kPacingInfo1);
OnSentPacket(later_packet);
adapter_->OnTransportFeedback(feedback);
@@ -210,11 +224,11 @@ TEST_F(TransportFeedbackAdapterTest, LongFeedbackDelays) {
TEST_F(TransportFeedbackAdapterTest, HandlesDroppedPackets) {
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(100, 200, 0, 1500, 1));
- packets.push_back(PacketInfo(110, 210, 1, 1500, 2));
- packets.push_back(PacketInfo(120, 220, 2, 1500, 3));
- packets.push_back(PacketInfo(130, 230, 3, 1500, 4));
- packets.push_back(PacketInfo(140, 240, 4, 1500, 5));
+ packets.push_back(PacketInfo(100, 200, 0, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(110, 210, 1, 1500, kPacingInfo1));
+ packets.push_back(PacketInfo(120, 220, 2, 1500, kPacingInfo2));
+ packets.push_back(PacketInfo(130, 230, 3, 1500, kPacingInfo3));
+ packets.push_back(PacketInfo(140, 240, 4, 1500, kPacingInfo4));
const uint16_t kSendSideDropBefore = 1;
const uint16_t kReceiveSideDropAfter = 3;
@@ -243,7 +257,6 @@ TEST_F(TransportFeedbackAdapterTest, HandlesDroppedPackets) {
// information stored on the send-side.
for (size_t i = 0; i < kSendSideDropBefore; ++i) {
expected_packets[i].send_time_ms = -1;
- expected_packets[i].probe_cluster_id = -1;
expected_packets[i].payload_size = 0;
}
@@ -257,12 +270,12 @@ TEST_F(TransportFeedbackAdapterTest, SendTimeWrapsBothWays) {
static_cast<int64_t>(1 << 8) *
static_cast<int64_t>((1 << 23) - 1) / 1000;
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(kHighArrivalTimeMs - 64, 200, 0, 1500,
- PacedPacketInfo::kNotAProbe));
- packets.push_back(PacketInfo(kHighArrivalTimeMs + 64, 210, 1, 1500,
- PacedPacketInfo::kNotAProbe));
- packets.push_back(PacketInfo(kHighArrivalTimeMs, 220, 2, 1500,
- PacedPacketInfo::kNotAProbe));
+ packets.push_back(
+ PacketInfo(kHighArrivalTimeMs - 64, 200, 0, 1500, PacedPacketInfo()));
+ packets.push_back(
+ PacketInfo(kHighArrivalTimeMs + 64, 210, 1, 1500, PacedPacketInfo()));
+ packets.push_back(
+ PacketInfo(kHighArrivalTimeMs, 220, 2, 1500, PacedPacketInfo()));
for (const PacketInfo& packet : packets)
OnSentPacket(packet);
@@ -291,9 +304,9 @@ TEST_F(TransportFeedbackAdapterTest, SendTimeWrapsBothWays) {
TEST_F(TransportFeedbackAdapterTest, HandlesReordering) {
std::vector<PacketInfo> packets;
- packets.push_back(PacketInfo(120, 200, 0, 1500, 0));
- packets.push_back(PacketInfo(110, 210, 1, 1500, 0));
- packets.push_back(PacketInfo(100, 220, 2, 1500, 0));
+ packets.push_back(PacketInfo(120, 200, 0, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(110, 210, 1, 1500, kPacingInfo0));
+ packets.push_back(PacketInfo(100, 220, 2, 1500, kPacingInfo0));
std::vector<PacketInfo> expected_packets;
expected_packets.push_back(packets[2]);
expected_packets.push_back(packets[1]);
@@ -329,7 +342,7 @@ TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) {
rtcp::TransportFeedback::kDeltaScaleFactor *
std::numeric_limits<int16_t>::min();
- PacketInfo info(100, 200, 0, 1500, true, PacedPacketInfo::kNotAProbe);
+ PacketInfo info(100, 200, 0, 1500, true, PacedPacketInfo());
sent_packets.push_back(info);
info.send_time_ms += kSmallDeltaUs / 1000;
@@ -418,7 +431,7 @@ TEST_F(TransportFeedbackAdapterTest, UpdatesDelayBasedEstimate) {
int64_t start_time_ms = clock_.TimeInMilliseconds();
while (clock_.TimeInMilliseconds() - start_time_ms < kRunTimeMs) {
PacketInfo packet(clock_.TimeInMilliseconds(), clock_.TimeInMilliseconds(),
- seq_num, kPayloadSize, PacedPacketInfo::kNotAProbe);
+ seq_num, kPayloadSize, PacedPacketInfo());
OnSentPacket(packet);
// Create expected feedback and send into adapter.
std::unique_ptr<rtcp::TransportFeedback> feedback(

Powered by Google App Engine
This is Rietveld 408576698