OLD | NEW |
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 |
11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" |
12 | 12 |
13 #include <limits> | 13 #include <limits> |
14 | 14 |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
17 | 17 |
18 using webrtc::rtcp::RawPacket; | 18 using webrtc::rtcp::RawPacket; |
19 using webrtc::rtcp::ExtendedJitterReport; | 19 using webrtc::rtcp::ExtendedJitterReport; |
20 using webrtc::RTCPUtility::RtcpCommonHeader; | 20 using webrtc::RTCPUtility::RtcpCommonHeader; |
21 using webrtc::RTCPUtility::RtcpParseCommonHeader; | 21 using webrtc::RTCPUtility::RtcpParseCommonHeader; |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 namespace { | 24 namespace { |
25 | 25 |
26 class RtcpPacketExtendedJitterReportTest : public ::testing::Test { | 26 class RtcpPacketExtendedJitterReportTest : public ::testing::Test { |
27 protected: | 27 protected: |
28 void BuildPacket() { packet = ij.Build().Pass(); } | 28 void BuildPacket() { packet = ij.Build(); } |
29 void ParsePacket() { | 29 void ParsePacket() { |
30 RtcpCommonHeader header; | 30 RtcpCommonHeader header; |
31 EXPECT_TRUE( | 31 EXPECT_TRUE( |
32 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); | 32 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); |
33 EXPECT_EQ(header.BlockSize(), packet->Length()); | 33 EXPECT_EQ(header.BlockSize(), packet->Length()); |
34 EXPECT_TRUE(parsed_.Parse( | 34 EXPECT_TRUE(parsed_.Parse( |
35 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); | 35 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); |
36 } | 36 } |
37 | 37 |
38 ExtendedJitterReport ij; | 38 ExtendedJitterReport ij; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 header.count_or_format++; // Damage package. | 89 header.count_or_format++; // Damage package. |
90 | 90 |
91 ExtendedJitterReport parsed; | 91 ExtendedJitterReport parsed; |
92 | 92 |
93 EXPECT_FALSE(parsed.Parse( | 93 EXPECT_FALSE(parsed.Parse( |
94 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); | 94 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); |
95 } | 95 } |
96 | 96 |
97 } // namespace | 97 } // namespace |
98 } // namespace webrtc | 98 } // namespace webrtc |
OLD | NEW |