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

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

Issue 1575023002: [rtp_rtcp] rtcp::Tmmbr moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h"
12
13 #include "testing/gtest/include/gtest/gtest.h"
14
15 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
16 #include "webrtc/test/rtcp_packet_parser.h"
17
18 using webrtc::rtcp::RawPacket;
19 using webrtc::rtcp::Tmmbr;
20 using webrtc::test::RtcpPacketParser;
21
22 namespace webrtc {
23 const uint32_t kSenderSsrc = 0x12345678;
24 const uint32_t kRemoteSsrc = 0x23456789;
25
26 TEST(RtcpPacketTest, Tmmbr) {
27 Tmmbr tmmbr;
28 tmmbr.From(kSenderSsrc);
29 tmmbr.To(kRemoteSsrc);
30 tmmbr.WithBitrateKbps(312);
31 tmmbr.WithOverhead(60);
32
33 rtc::scoped_ptr<RawPacket> packet(tmmbr.Build());
34 RtcpPacketParser parser;
35 parser.Parse(packet->Buffer(), packet->Length());
36 EXPECT_EQ(1, parser.tmmbr()->num_packets());
37 EXPECT_EQ(kSenderSsrc, parser.tmmbr()->Ssrc());
38 EXPECT_EQ(1, parser.tmmbr_item()->num_packets());
39 EXPECT_EQ(312U, parser.tmmbr_item()->BitrateKbps());
40 EXPECT_EQ(60U, parser.tmmbr_item()->Overhead());
41 }
42
43 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698