OLD | NEW |
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 * This file includes unit tests for the RtcpPacket. | 10 * This file includes unit tests for the RtcpPacket. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 rb.To(kRemoteSsrc); | 64 rb.To(kRemoteSsrc); |
65 rb.WithFractionLost(55); | 65 rb.WithFractionLost(55); |
66 rb.WithCumulativeLost(0x111111); | 66 rb.WithCumulativeLost(0x111111); |
67 rb.WithExtHighestSeqNum(0x22222222); | 67 rb.WithExtHighestSeqNum(0x22222222); |
68 rb.WithJitter(0x33333333); | 68 rb.WithJitter(0x33333333); |
69 rb.WithLastSr(0x44444444); | 69 rb.WithLastSr(0x44444444); |
70 rb.WithDelayLastSr(0x55555555); | 70 rb.WithDelayLastSr(0x55555555); |
71 | 71 |
72 ReceiverReport rr; | 72 ReceiverReport rr; |
73 rr.From(kSenderSsrc); | 73 rr.From(kSenderSsrc); |
74 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 74 EXPECT_TRUE(rr.WithReportBlock(rb)); |
75 | 75 |
76 rtc::scoped_ptr<RawPacket> packet(rr.Build()); | 76 rtc::scoped_ptr<RawPacket> packet(rr.Build()); |
77 RtcpPacketParser parser; | 77 RtcpPacketParser parser; |
78 parser.Parse(packet->Buffer(), packet->Length()); | 78 parser.Parse(packet->Buffer(), packet->Length()); |
79 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 79 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
80 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); | 80 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); |
81 EXPECT_EQ(1, parser.report_block()->num_packets()); | 81 EXPECT_EQ(1, parser.report_block()->num_packets()); |
82 EXPECT_EQ(kRemoteSsrc, parser.report_block()->Ssrc()); | 82 EXPECT_EQ(kRemoteSsrc, parser.report_block()->Ssrc()); |
83 EXPECT_EQ(55U, parser.report_block()->FractionLost()); | 83 EXPECT_EQ(55U, parser.report_block()->FractionLost()); |
84 EXPECT_EQ(0x111111U, parser.report_block()->CumPacketLost()); | 84 EXPECT_EQ(0x111111U, parser.report_block()->CumPacketLost()); |
85 EXPECT_EQ(0x22222222U, parser.report_block()->ExtHighestSeqNum()); | 85 EXPECT_EQ(0x22222222U, parser.report_block()->ExtHighestSeqNum()); |
86 EXPECT_EQ(0x33333333U, parser.report_block()->Jitter()); | 86 EXPECT_EQ(0x33333333U, parser.report_block()->Jitter()); |
87 EXPECT_EQ(0x44444444U, parser.report_block()->LastSr()); | 87 EXPECT_EQ(0x44444444U, parser.report_block()->LastSr()); |
88 EXPECT_EQ(0x55555555U, parser.report_block()->DelayLastSr()); | 88 EXPECT_EQ(0x55555555U, parser.report_block()->DelayLastSr()); |
89 } | 89 } |
90 | 90 |
91 TEST(RtcpPacketTest, RrWithTwoReportBlocks) { | 91 TEST(RtcpPacketTest, RrWithTwoReportBlocks) { |
92 ReportBlock rb1; | 92 ReportBlock rb1; |
93 rb1.To(kRemoteSsrc); | 93 rb1.To(kRemoteSsrc); |
94 ReportBlock rb2; | 94 ReportBlock rb2; |
95 rb2.To(kRemoteSsrc + 1); | 95 rb2.To(kRemoteSsrc + 1); |
96 | 96 |
97 ReceiverReport rr; | 97 ReceiverReport rr; |
98 rr.From(kSenderSsrc); | 98 rr.From(kSenderSsrc); |
99 EXPECT_TRUE(rr.WithReportBlock(&rb1)); | 99 EXPECT_TRUE(rr.WithReportBlock(rb1)); |
100 EXPECT_TRUE(rr.WithReportBlock(&rb2)); | 100 EXPECT_TRUE(rr.WithReportBlock(rb2)); |
101 | 101 |
102 rtc::scoped_ptr<RawPacket> packet(rr.Build()); | 102 rtc::scoped_ptr<RawPacket> packet(rr.Build()); |
103 RtcpPacketParser parser; | 103 RtcpPacketParser parser; |
104 parser.Parse(packet->Buffer(), packet->Length()); | 104 parser.Parse(packet->Buffer(), packet->Length()); |
105 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 105 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
106 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); | 106 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); |
107 EXPECT_EQ(2, parser.report_block()->num_packets()); | 107 EXPECT_EQ(2, parser.report_block()->num_packets()); |
108 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc)); | 108 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc)); |
109 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc + 1)); | 109 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc + 1)); |
110 } | 110 } |
111 | 111 |
112 TEST(RtcpPacketTest, RrWithTooManyReportBlocks) { | 112 TEST(RtcpPacketTest, RrWithTooManyReportBlocks) { |
113 ReceiverReport rr; | 113 ReceiverReport rr; |
114 rr.From(kSenderSsrc); | 114 rr.From(kSenderSsrc); |
115 const int kMaxReportBlocks = (1 << 5) - 1; | 115 const int kMaxReportBlocks = (1 << 5) - 1; |
116 ReportBlock rb; | 116 ReportBlock rb; |
117 for (int i = 0; i < kMaxReportBlocks; ++i) { | 117 for (int i = 0; i < kMaxReportBlocks; ++i) { |
118 rb.To(kRemoteSsrc + i); | 118 rb.To(kRemoteSsrc + i); |
119 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 119 EXPECT_TRUE(rr.WithReportBlock(rb)); |
120 } | 120 } |
121 rb.To(kRemoteSsrc + kMaxReportBlocks); | 121 rb.To(kRemoteSsrc + kMaxReportBlocks); |
122 EXPECT_FALSE(rr.WithReportBlock(&rb)); | 122 EXPECT_FALSE(rr.WithReportBlock(rb)); |
123 } | 123 } |
124 | 124 |
125 TEST(RtcpPacketTest, Sr) { | 125 TEST(RtcpPacketTest, Sr) { |
126 SenderReport sr; | 126 SenderReport sr; |
127 sr.From(kSenderSsrc); | 127 sr.From(kSenderSsrc); |
128 sr.WithNtpSec(0x11111111); | 128 sr.WithNtpSec(0x11111111); |
129 sr.WithNtpFrac(0x22222222); | 129 sr.WithNtpFrac(0x22222222); |
130 sr.WithRtpTimestamp(0x33333333); | 130 sr.WithRtpTimestamp(0x33333333); |
131 sr.WithPacketCount(0x44444444); | 131 sr.WithPacketCount(0x44444444); |
132 sr.WithOctetCount(0x55555555); | 132 sr.WithOctetCount(0x55555555); |
(...skipping 11 matching lines...) Expand all Loading... |
144 EXPECT_EQ(0x55555555U, parser.sender_report()->OctetCount()); | 144 EXPECT_EQ(0x55555555U, parser.sender_report()->OctetCount()); |
145 EXPECT_EQ(0, parser.report_block()->num_packets()); | 145 EXPECT_EQ(0, parser.report_block()->num_packets()); |
146 } | 146 } |
147 | 147 |
148 TEST(RtcpPacketTest, SrWithOneReportBlock) { | 148 TEST(RtcpPacketTest, SrWithOneReportBlock) { |
149 ReportBlock rb; | 149 ReportBlock rb; |
150 rb.To(kRemoteSsrc); | 150 rb.To(kRemoteSsrc); |
151 | 151 |
152 SenderReport sr; | 152 SenderReport sr; |
153 sr.From(kSenderSsrc); | 153 sr.From(kSenderSsrc); |
154 EXPECT_TRUE(sr.WithReportBlock(&rb)); | 154 EXPECT_TRUE(sr.WithReportBlock(rb)); |
155 | 155 |
156 rtc::scoped_ptr<RawPacket> packet(sr.Build()); | 156 rtc::scoped_ptr<RawPacket> packet(sr.Build()); |
157 RtcpPacketParser parser; | 157 RtcpPacketParser parser; |
158 parser.Parse(packet->Buffer(), packet->Length()); | 158 parser.Parse(packet->Buffer(), packet->Length()); |
159 EXPECT_EQ(1, parser.sender_report()->num_packets()); | 159 EXPECT_EQ(1, parser.sender_report()->num_packets()); |
160 EXPECT_EQ(kSenderSsrc, parser.sender_report()->Ssrc()); | 160 EXPECT_EQ(kSenderSsrc, parser.sender_report()->Ssrc()); |
161 EXPECT_EQ(1, parser.report_block()->num_packets()); | 161 EXPECT_EQ(1, parser.report_block()->num_packets()); |
162 EXPECT_EQ(kRemoteSsrc, parser.report_block()->Ssrc()); | 162 EXPECT_EQ(kRemoteSsrc, parser.report_block()->Ssrc()); |
163 } | 163 } |
164 | 164 |
165 TEST(RtcpPacketTest, SrWithTwoReportBlocks) { | 165 TEST(RtcpPacketTest, SrWithTwoReportBlocks) { |
166 ReportBlock rb1; | 166 ReportBlock rb1; |
167 rb1.To(kRemoteSsrc); | 167 rb1.To(kRemoteSsrc); |
168 ReportBlock rb2; | 168 ReportBlock rb2; |
169 rb2.To(kRemoteSsrc + 1); | 169 rb2.To(kRemoteSsrc + 1); |
170 | 170 |
171 SenderReport sr; | 171 SenderReport sr; |
172 sr.From(kSenderSsrc); | 172 sr.From(kSenderSsrc); |
173 EXPECT_TRUE(sr.WithReportBlock(&rb1)); | 173 EXPECT_TRUE(sr.WithReportBlock(rb1)); |
174 EXPECT_TRUE(sr.WithReportBlock(&rb2)); | 174 EXPECT_TRUE(sr.WithReportBlock(rb2)); |
175 | 175 |
176 rtc::scoped_ptr<RawPacket> packet(sr.Build()); | 176 rtc::scoped_ptr<RawPacket> packet(sr.Build()); |
177 RtcpPacketParser parser; | 177 RtcpPacketParser parser; |
178 parser.Parse(packet->Buffer(), packet->Length()); | 178 parser.Parse(packet->Buffer(), packet->Length()); |
179 EXPECT_EQ(1, parser.sender_report()->num_packets()); | 179 EXPECT_EQ(1, parser.sender_report()->num_packets()); |
180 EXPECT_EQ(kSenderSsrc, parser.sender_report()->Ssrc()); | 180 EXPECT_EQ(kSenderSsrc, parser.sender_report()->Ssrc()); |
181 EXPECT_EQ(2, parser.report_block()->num_packets()); | 181 EXPECT_EQ(2, parser.report_block()->num_packets()); |
182 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc)); | 182 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc)); |
183 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc + 1)); | 183 EXPECT_EQ(1, parser.report_blocks_per_ssrc(kRemoteSsrc + 1)); |
184 } | 184 } |
185 | 185 |
186 TEST(RtcpPacketTest, SrWithTooManyReportBlocks) { | 186 TEST(RtcpPacketTest, SrWithTooManyReportBlocks) { |
187 SenderReport sr; | 187 SenderReport sr; |
188 sr.From(kSenderSsrc); | 188 sr.From(kSenderSsrc); |
189 const int kMaxReportBlocks = (1 << 5) - 1; | 189 const int kMaxReportBlocks = (1 << 5) - 1; |
190 ReportBlock rb; | 190 ReportBlock rb; |
191 for (int i = 0; i < kMaxReportBlocks; ++i) { | 191 for (int i = 0; i < kMaxReportBlocks; ++i) { |
192 rb.To(kRemoteSsrc + i); | 192 rb.To(kRemoteSsrc + i); |
193 EXPECT_TRUE(sr.WithReportBlock(&rb)); | 193 EXPECT_TRUE(sr.WithReportBlock(rb)); |
194 } | 194 } |
195 rb.To(kRemoteSsrc + kMaxReportBlocks); | 195 rb.To(kRemoteSsrc + kMaxReportBlocks); |
196 EXPECT_FALSE(sr.WithReportBlock(&rb)); | 196 EXPECT_FALSE(sr.WithReportBlock(rb)); |
197 } | 197 } |
198 | 198 |
199 TEST(RtcpPacketTest, IjNoItem) { | 199 TEST(RtcpPacketTest, IjNoItem) { |
200 Ij ij; | 200 Ij ij; |
201 | 201 |
202 rtc::scoped_ptr<RawPacket> packet(ij.Build()); | 202 rtc::scoped_ptr<RawPacket> packet(ij.Build()); |
203 RtcpPacketParser parser; | 203 RtcpPacketParser parser; |
204 parser.Parse(packet->Buffer(), packet->Length()); | 204 parser.Parse(packet->Buffer(), packet->Length()); |
205 EXPECT_EQ(1, parser.ij()->num_packets()); | 205 EXPECT_EQ(1, parser.ij()->num_packets()); |
206 EXPECT_EQ(0, parser.ij_item()->num_packets()); | 206 EXPECT_EQ(0, parser.ij_item()->num_packets()); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 EXPECT_EQ(1, parser.fir_item()->num_packets()); | 560 EXPECT_EQ(1, parser.fir_item()->num_packets()); |
561 EXPECT_EQ(kRemoteSsrc, parser.fir_item()->Ssrc()); | 561 EXPECT_EQ(kRemoteSsrc, parser.fir_item()->Ssrc()); |
562 EXPECT_EQ(123U, parser.fir_item()->SeqNum()); | 562 EXPECT_EQ(123U, parser.fir_item()->SeqNum()); |
563 } | 563 } |
564 | 564 |
565 TEST(RtcpPacketTest, AppendPacket) { | 565 TEST(RtcpPacketTest, AppendPacket) { |
566 Fir fir; | 566 Fir fir; |
567 ReportBlock rb; | 567 ReportBlock rb; |
568 ReceiverReport rr; | 568 ReceiverReport rr; |
569 rr.From(kSenderSsrc); | 569 rr.From(kSenderSsrc); |
570 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 570 EXPECT_TRUE(rr.WithReportBlock(rb)); |
571 rr.Append(&fir); | 571 rr.Append(&fir); |
572 | 572 |
573 rtc::scoped_ptr<RawPacket> packet(rr.Build()); | 573 rtc::scoped_ptr<RawPacket> packet(rr.Build()); |
574 RtcpPacketParser parser; | 574 RtcpPacketParser parser; |
575 parser.Parse(packet->Buffer(), packet->Length()); | 575 parser.Parse(packet->Buffer(), packet->Length()); |
576 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 576 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
577 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); | 577 EXPECT_EQ(kSenderSsrc, parser.receiver_report()->Ssrc()); |
578 EXPECT_EQ(1, parser.report_block()->num_packets()); | 578 EXPECT_EQ(1, parser.report_block()->num_packets()); |
579 EXPECT_EQ(1, parser.fir()->num_packets()); | 579 EXPECT_EQ(1, parser.fir()->num_packets()); |
580 } | 580 } |
(...skipping 10 matching lines...) Expand all Loading... |
591 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 591 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
592 EXPECT_EQ(0, parser.report_block()->num_packets()); | 592 EXPECT_EQ(0, parser.report_block()->num_packets()); |
593 } | 593 } |
594 | 594 |
595 TEST(RtcpPacketTest, AppendPacketWithOwnAppendedPacket) { | 595 TEST(RtcpPacketTest, AppendPacketWithOwnAppendedPacket) { |
596 Fir fir; | 596 Fir fir; |
597 Bye bye; | 597 Bye bye; |
598 ReportBlock rb; | 598 ReportBlock rb; |
599 | 599 |
600 ReceiverReport rr; | 600 ReceiverReport rr; |
601 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 601 EXPECT_TRUE(rr.WithReportBlock(rb)); |
602 rr.Append(&fir); | 602 rr.Append(&fir); |
603 | 603 |
604 SenderReport sr; | 604 SenderReport sr; |
605 sr.Append(&bye); | 605 sr.Append(&bye); |
606 sr.Append(&rr); | 606 sr.Append(&rr); |
607 | 607 |
608 rtc::scoped_ptr<RawPacket> packet(sr.Build()); | 608 rtc::scoped_ptr<RawPacket> packet(sr.Build()); |
609 RtcpPacketParser parser; | 609 RtcpPacketParser parser; |
610 parser.Parse(packet->Buffer(), packet->Length()); | 610 parser.Parse(packet->Buffer(), packet->Length()); |
611 EXPECT_EQ(1, parser.sender_report()->num_packets()); | 611 EXPECT_EQ(1, parser.sender_report()->num_packets()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 EXPECT_TRUE(bye.WithCsrc(i)); | 650 EXPECT_TRUE(bye.WithCsrc(i)); |
651 } | 651 } |
652 EXPECT_FALSE(bye.WithCsrc(kMaxCsrcs)); | 652 EXPECT_FALSE(bye.WithCsrc(kMaxCsrcs)); |
653 } | 653 } |
654 | 654 |
655 TEST(RtcpPacketTest, BuildWithInputBuffer) { | 655 TEST(RtcpPacketTest, BuildWithInputBuffer) { |
656 Fir fir; | 656 Fir fir; |
657 ReportBlock rb; | 657 ReportBlock rb; |
658 ReceiverReport rr; | 658 ReceiverReport rr; |
659 rr.From(kSenderSsrc); | 659 rr.From(kSenderSsrc); |
660 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 660 EXPECT_TRUE(rr.WithReportBlock(rb)); |
661 rr.Append(&fir); | 661 rr.Append(&fir); |
662 | 662 |
663 const size_t kRrLength = 8; | 663 const size_t kRrLength = 8; |
664 const size_t kReportBlockLength = 24; | 664 const size_t kReportBlockLength = 24; |
665 const size_t kFirLength = 20; | 665 const size_t kFirLength = 20; |
666 | 666 |
667 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { | 667 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { |
668 public: | 668 public: |
669 void OnPacketReady(uint8_t* data, size_t length) override { | 669 void OnPacketReady(uint8_t* data, size_t length) override { |
670 RtcpPacketParser parser; | 670 RtcpPacketParser parser; |
671 parser.Parse(data, length); | 671 parser.Parse(data, length); |
672 EXPECT_EQ(1, parser.receiver_report()->num_packets()); | 672 EXPECT_EQ(1, parser.receiver_report()->num_packets()); |
673 EXPECT_EQ(1, parser.report_block()->num_packets()); | 673 EXPECT_EQ(1, parser.report_block()->num_packets()); |
674 EXPECT_EQ(1, parser.fir()->num_packets()); | 674 EXPECT_EQ(1, parser.fir()->num_packets()); |
675 ++packets_created_; | 675 ++packets_created_; |
676 } | 676 } |
677 | 677 |
678 int packets_created_ = 0; | 678 int packets_created_ = 0; |
679 } verifier; | 679 } verifier; |
680 const size_t kBufferSize = kRrLength + kReportBlockLength + kFirLength; | 680 const size_t kBufferSize = kRrLength + kReportBlockLength + kFirLength; |
681 uint8_t buffer[kBufferSize]; | 681 uint8_t buffer[kBufferSize]; |
682 EXPECT_TRUE(rr.BuildExternalBuffer(buffer, kBufferSize, &verifier)); | 682 EXPECT_TRUE(rr.BuildExternalBuffer(buffer, kBufferSize, &verifier)); |
683 EXPECT_EQ(1, verifier.packets_created_); | 683 EXPECT_EQ(1, verifier.packets_created_); |
684 } | 684 } |
685 | 685 |
686 TEST(RtcpPacketTest, BuildWithTooSmallBuffer) { | 686 TEST(RtcpPacketTest, BuildWithTooSmallBuffer) { |
687 ReportBlock rb; | 687 ReportBlock rb; |
688 ReceiverReport rr; | 688 ReceiverReport rr; |
689 rr.From(kSenderSsrc); | 689 rr.From(kSenderSsrc); |
690 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 690 EXPECT_TRUE(rr.WithReportBlock(rb)); |
691 | 691 |
692 const size_t kRrLength = 8; | 692 const size_t kRrLength = 8; |
693 const size_t kReportBlockLength = 24; | 693 const size_t kReportBlockLength = 24; |
694 | 694 |
695 // No packet. | 695 // No packet. |
696 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { | 696 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { |
697 void OnPacketReady(uint8_t* data, size_t length) override { | 697 void OnPacketReady(uint8_t* data, size_t length) override { |
698 ADD_FAILURE() << "Packet should not fit within max size."; | 698 ADD_FAILURE() << "Packet should not fit within max size."; |
699 } | 699 } |
700 } verifier; | 700 } verifier; |
701 const size_t kBufferSize = kRrLength + kReportBlockLength - 1; | 701 const size_t kBufferSize = kRrLength + kReportBlockLength - 1; |
702 uint8_t buffer[kBufferSize]; | 702 uint8_t buffer[kBufferSize]; |
703 EXPECT_FALSE(rr.BuildExternalBuffer(buffer, kBufferSize, &verifier)); | 703 EXPECT_FALSE(rr.BuildExternalBuffer(buffer, kBufferSize, &verifier)); |
704 } | 704 } |
705 | 705 |
706 TEST(RtcpPacketTest, BuildWithTooSmallBuffer_FragmentedSend) { | 706 TEST(RtcpPacketTest, BuildWithTooSmallBuffer_FragmentedSend) { |
707 Fir fir; | 707 Fir fir; |
708 ReportBlock rb; | 708 ReportBlock rb; |
709 ReceiverReport rr; | 709 ReceiverReport rr; |
710 rr.From(kSenderSsrc); | 710 rr.From(kSenderSsrc); |
711 EXPECT_TRUE(rr.WithReportBlock(&rb)); | 711 EXPECT_TRUE(rr.WithReportBlock(rb)); |
712 rr.Append(&fir); | 712 rr.Append(&fir); |
713 | 713 |
714 const size_t kRrLength = 8; | 714 const size_t kRrLength = 8; |
715 const size_t kReportBlockLength = 24; | 715 const size_t kReportBlockLength = 24; |
716 | 716 |
717 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { | 717 class Verifier : public rtcp::RtcpPacket::PacketReadyCallback { |
718 public: | 718 public: |
719 void OnPacketReady(uint8_t* data, size_t length) override { | 719 void OnPacketReady(uint8_t* data, size_t length) override { |
720 RtcpPacketParser parser; | 720 RtcpPacketParser parser; |
721 parser.Parse(data, length); | 721 parser.Parse(data, length); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 for (int i = 0; i < kMaxBlocks; ++i) | 1078 for (int i = 0; i < kMaxBlocks; ++i) |
1079 EXPECT_TRUE(xr.WithDlrr(&dlrr)); | 1079 EXPECT_TRUE(xr.WithDlrr(&dlrr)); |
1080 EXPECT_FALSE(xr.WithDlrr(&dlrr)); | 1080 EXPECT_FALSE(xr.WithDlrr(&dlrr)); |
1081 | 1081 |
1082 VoipMetric voip_metric; | 1082 VoipMetric voip_metric; |
1083 for (int i = 0; i < kMaxBlocks; ++i) | 1083 for (int i = 0; i < kMaxBlocks; ++i) |
1084 EXPECT_TRUE(xr.WithVoipMetric(&voip_metric)); | 1084 EXPECT_TRUE(xr.WithVoipMetric(&voip_metric)); |
1085 EXPECT_FALSE(xr.WithVoipMetric(&voip_metric)); | 1085 EXPECT_FALSE(xr.WithVoipMetric(&voip_metric)); |
1086 } | 1086 } |
1087 } // namespace webrtc | 1087 } // namespace webrtc |
OLD | NEW |