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

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

Issue 1376673004: Add a PacketOptions struct to webrtc::Transport. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment added Created 5 years, 2 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 rtp_packets_sent_(0) { 54 rtp_packets_sent_(0) {
55 } 55 }
56 56
57 void SetRtpRtcpModule(ModuleRtpRtcpImpl* receiver) { 57 void SetRtpRtcpModule(ModuleRtpRtcpImpl* receiver) {
58 receiver_ = receiver; 58 receiver_ = receiver;
59 } 59 }
60 void SimulateNetworkDelay(int64_t delay_ms, SimulatedClock* clock) { 60 void SimulateNetworkDelay(int64_t delay_ms, SimulatedClock* clock) {
61 clock_ = clock; 61 clock_ = clock;
62 delay_ms_ = delay_ms; 62 delay_ms_ = delay_ms;
63 } 63 }
64 bool SendRtp(const uint8_t* data, size_t len) override { 64 bool SendRtp(const uint8_t* data,
65 size_t len,
66 const PacketOptions& options) override {
65 RTPHeader header; 67 RTPHeader header;
66 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); 68 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
67 EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header)); 69 EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header));
68 ++rtp_packets_sent_; 70 ++rtp_packets_sent_;
69 last_rtp_header_ = header; 71 last_rtp_header_ = header;
70 return true; 72 return true;
71 } 73 }
72 bool SendRtcp(const uint8_t* data, size_t len) override { 74 bool SendRtcp(const uint8_t* data, size_t len) override {
73 test::RtcpPacketParser parser; 75 test::RtcpPacketParser parser;
74 parser.Parse(static_cast<const uint8_t*>(data), len); 76 parser.Parse(static_cast<const uint8_t*>(data), len);
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); 517 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21));
516 518
517 // Send module receives the request. 519 // Send module receives the request.
518 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); 520 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets);
519 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); 521 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests);
520 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); 522 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests);
521 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); 523 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent());
522 } 524 }
523 525
524 } // namespace webrtc 526 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698