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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc

Issue 1696203002: [rtp_rtcp] rtc::scoped_ptr<rtcp::RawPacket> replaced with rtc::Buffer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) { 217 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) {
218 bool sender = module->impl_->SSRC() == kSenderSsrc; 218 bool sender = module->impl_->SSRC() == kSenderSsrc;
219 rtcp::Nack nack; 219 rtcp::Nack nack;
220 uint16_t list[1]; 220 uint16_t list[1];
221 list[0] = sequence_number; 221 list[0] = sequence_number;
222 const uint16_t kListLength = sizeof(list) / sizeof(list[0]); 222 const uint16_t kListLength = sizeof(list) / sizeof(list[0]);
223 nack.From(sender ? kReceiverSsrc : kSenderSsrc); 223 nack.From(sender ? kReceiverSsrc : kSenderSsrc);
224 nack.To(sender ? kSenderSsrc : kReceiverSsrc); 224 nack.To(sender ? kSenderSsrc : kReceiverSsrc);
225 nack.WithList(list, kListLength); 225 nack.WithList(list, kListLength);
226 rtc::scoped_ptr<rtcp::RawPacket> packet(nack.Build()); 226 rtc::Buffer packet = nack.Build();
227 EXPECT_EQ(0, module->impl_->IncomingRtcpPacket(packet->Buffer(), 227 EXPECT_EQ(0, module->impl_->IncomingRtcpPacket(packet.data(),
228 packet->Length())); 228 packet.size()));
229 } 229 }
230 }; 230 };
231 231
232 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) { 232 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) {
233 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer); 233 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer);
234 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions()); 234 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions());
235 235
236 // Send frames. 236 // Send frames.
237 EXPECT_EQ(0, sender_.RtpSent()); 237 EXPECT_EQ(0, sender_.RtpSent());
238 SendFrame(&sender_, kBaseLayerTid); // kSequenceNumber 238 SendFrame(&sender_, kBaseLayerTid); // kSequenceNumber
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); 541 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests);
542 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); 542 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21));
543 543
544 // Send module receives the request. 544 // Send module receives the request.
545 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); 545 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets);
546 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); 546 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests);
547 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); 547 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests);
548 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); 548 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent());
549 } 549 }
550 } // namespace webrtc 550 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698