| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const uint32_t kSenderSsrc = 0x12345678; | 27 const uint32_t kSenderSsrc = 0x12345678; |
| 28 const uint32_t kCsrc1 = 0x22232425; | 28 const uint32_t kCsrc1 = 0x22232425; |
| 29 const uint32_t kCsrc2 = 0x33343536; | 29 const uint32_t kCsrc2 = 0x33343536; |
| 30 | 30 |
| 31 class RtcpPacketByeTest : public ::testing::Test { | 31 class RtcpPacketByeTest : public ::testing::Test { |
| 32 protected: | 32 protected: |
| 33 void BuildPacket() { packet = bye.Build().Pass(); } | 33 void BuildPacket() { packet = bye.Build(); } |
| 34 void ParsePacket() { | 34 void ParsePacket() { |
| 35 RtcpCommonHeader header; | 35 RtcpCommonHeader header; |
| 36 EXPECT_TRUE( | 36 EXPECT_TRUE( |
| 37 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); | 37 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); |
| 38 // Check that there is exactly one RTCP packet in the buffer. | 38 // Check that there is exactly one RTCP packet in the buffer. |
| 39 EXPECT_EQ(header.BlockSize(), packet->Length()); | 39 EXPECT_EQ(header.BlockSize(), packet->Length()); |
| 40 EXPECT_TRUE(parsed_bye.Parse( | 40 EXPECT_TRUE(parsed_bye.Parse( |
| 41 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); | 41 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); |
| 42 } | 42 } |
| 43 | 43 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 RtcpCommonHeader header; | 164 RtcpCommonHeader header; |
| 165 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header); | 165 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header); |
| 166 header.payload_size_bytes -= 4; // Payload is usually 32bit aligned. | 166 header.payload_size_bytes -= 4; // Payload is usually 32bit aligned. |
| 167 | 167 |
| 168 EXPECT_FALSE(parsed_bye.Parse( | 168 EXPECT_FALSE(parsed_bye.Parse( |
| 169 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); | 169 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace | 172 } // namespace |
| 173 } // namespace webrtc | 173 } // namespace webrtc |
| OLD | NEW |