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

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

Issue 3009403002: Drop return value from RtpRtcp::IncomingRtcpPacket. (Closed)
Patch Set: Delete VoENetworkTest.ReceivedRTCPPacketWithJunkDataShouldFail. Created 3 years, 3 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 bool SendRtcp(const uint8_t* data, size_t len) override { 82 bool SendRtcp(const uint8_t* data, size_t len) override {
83 test::RtcpPacketParser parser; 83 test::RtcpPacketParser parser;
84 parser.Parse(data, len); 84 parser.Parse(data, len);
85 last_nack_list_ = parser.nack()->packet_ids(); 85 last_nack_list_ = parser.nack()->packet_ids();
86 86
87 if (clock_) { 87 if (clock_) {
88 clock_->AdvanceTimeMilliseconds(delay_ms_); 88 clock_->AdvanceTimeMilliseconds(delay_ms_);
89 } 89 }
90 EXPECT_TRUE(receiver_); 90 EXPECT_TRUE(receiver_);
91 EXPECT_EQ(0, receiver_->IncomingRtcpPacket(data, len)); 91 receiver_->IncomingRtcpPacket(data, len);
92 return true; 92 return true;
93 } 93 }
94 int32_t OnReceivedPayloadData(const uint8_t* payload_data, 94 int32_t OnReceivedPayloadData(const uint8_t* payload_data,
95 size_t payload_size, 95 size_t payload_size,
96 const WebRtcRTPHeader* rtp_header) override { 96 const WebRtcRTPHeader* rtp_header) override {
97 return 0; 97 return 0;
98 } 98 }
99 void SetKeepalivePayloadType(uint8_t payload_type) { 99 void SetKeepalivePayloadType(uint8_t payload_type) {
100 keepalive_payload_type_ = payload_type; 100 keepalive_payload_type_ = payload_type;
101 } 101 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) { 248 void IncomingRtcpNack(const RtpRtcpModule* module, uint16_t sequence_number) {
249 bool sender = module->impl_->SSRC() == kSenderSsrc; 249 bool sender = module->impl_->SSRC() == kSenderSsrc;
250 rtcp::Nack nack; 250 rtcp::Nack nack;
251 uint16_t list[1]; 251 uint16_t list[1];
252 list[0] = sequence_number; 252 list[0] = sequence_number;
253 const uint16_t kListLength = sizeof(list) / sizeof(list[0]); 253 const uint16_t kListLength = sizeof(list) / sizeof(list[0]);
254 nack.SetSenderSsrc(sender ? kReceiverSsrc : kSenderSsrc); 254 nack.SetSenderSsrc(sender ? kReceiverSsrc : kSenderSsrc);
255 nack.SetMediaSsrc(sender ? kSenderSsrc : kReceiverSsrc); 255 nack.SetMediaSsrc(sender ? kSenderSsrc : kReceiverSsrc);
256 nack.SetPacketIds(list, kListLength); 256 nack.SetPacketIds(list, kListLength);
257 rtc::Buffer packet = nack.Build(); 257 rtc::Buffer packet = nack.Build();
258 EXPECT_EQ(0, module->impl_->IncomingRtcpPacket(packet.data(), 258 module->impl_->IncomingRtcpPacket(packet.data(), packet.size());
259 packet.size()));
260 } 259 }
261 }; 260 };
262 261
263 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) { 262 TEST_F(RtpRtcpImplTest, SetSelectiveRetransmissions_BaseLayer) {
264 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer); 263 sender_.impl_->SetSelectiveRetransmissions(kRetransmitBaseLayer);
265 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions()); 264 EXPECT_EQ(kRetransmitBaseLayer, sender_.impl_->SelectiveRetransmissions());
266 265
267 // Send frames. 266 // Send frames.
268 EXPECT_EQ(0, sender_.RtpSent()); 267 EXPECT_EQ(0, sender_.RtpSent());
269 SendFrame(&sender_, kBaseLayerTid); // kSequenceNumber 268 SendFrame(&sender_, kBaseLayerTid); // kSequenceNumber
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 clock_.AdvanceTimeMilliseconds(kTimeoutMs - 1); 637 clock_.AdvanceTimeMilliseconds(kTimeoutMs - 1);
639 sender_.impl_->Process(); 638 sender_.impl_->Process();
640 EXPECT_EQ(2U, sender_.transport_.NumKeepaliveSent()); 639 EXPECT_EQ(2U, sender_.transport_.NumKeepaliveSent());
641 640
642 // Timeout relative payload, send new keep-alive. 641 // Timeout relative payload, send new keep-alive.
643 clock_.AdvanceTimeMilliseconds(1); 642 clock_.AdvanceTimeMilliseconds(1);
644 sender_.impl_->Process(); 643 sender_.impl_->Process();
645 EXPECT_EQ(3U, sender_.transport_.NumKeepaliveSent()); 644 EXPECT_EQ(3U, sender_.transport_.NumKeepaliveSent());
646 } 645 }
647 } // namespace webrtc 646 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698