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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/pli_unittest.cc

Issue 2348623003: Unify rtcp packet setters (Closed)
Patch Set: +call/rtc_event_log_unittest Created 4 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 22 matching lines...) Expand all
33 Pli mutable_parsed; 33 Pli mutable_parsed;
34 EXPECT_TRUE(test::ParseSinglePacket(kPacket, &mutable_parsed)); 34 EXPECT_TRUE(test::ParseSinglePacket(kPacket, &mutable_parsed));
35 const Pli& parsed = mutable_parsed; // Read values from constant object. 35 const Pli& parsed = mutable_parsed; // Read values from constant object.
36 36
37 EXPECT_EQ(kSenderSsrc, parsed.sender_ssrc()); 37 EXPECT_EQ(kSenderSsrc, parsed.sender_ssrc());
38 EXPECT_EQ(kRemoteSsrc, parsed.media_ssrc()); 38 EXPECT_EQ(kRemoteSsrc, parsed.media_ssrc());
39 } 39 }
40 40
41 TEST(RtcpPacketPliTest, Create) { 41 TEST(RtcpPacketPliTest, Create) {
42 Pli pli; 42 Pli pli;
43 pli.From(kSenderSsrc); 43 pli.SetSenderSsrc(kSenderSsrc);
44 pli.To(kRemoteSsrc); 44 pli.SetMediaSsrc(kRemoteSsrc);
45 45
46 rtc::Buffer packet = pli.Build(); 46 rtc::Buffer packet = pli.Build();
47 47
48 EXPECT_THAT(make_tuple(packet.data(), packet.size()), 48 EXPECT_THAT(make_tuple(packet.data(), packet.size()),
49 ElementsAreArray(kPacket)); 49 ElementsAreArray(kPacket));
50 } 50 }
51 51
52 TEST(RtcpPacketPliTest, ParseFailsOnTooSmallPacket) { 52 TEST(RtcpPacketPliTest, ParseFailsOnTooSmallPacket) {
53 const uint8_t kTooSmallPacket[] = {0x81, 206, 0x00, 0x01, 53 const uint8_t kTooSmallPacket[] = {0x81, 206, 0x00, 0x01,
54 0x12, 0x34, 0x56, 0x78}; 54 0x12, 0x34, 0x56, 0x78};
55 55
56 Pli parsed; 56 Pli parsed;
57 EXPECT_FALSE(test::ParseSinglePacket(kTooSmallPacket, &parsed)); 57 EXPECT_FALSE(test::ParseSinglePacket(kTooSmallPacket, &parsed));
58 } 58 }
59 59
60 } // namespace webrtc 60 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/nack_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698