| 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 21 matching lines...) Expand all Loading... |
| 32 // above. | 32 // above. |
| 33 // Having this block allows to test Create and Parse separately. | 33 // Having this block allows to test Create and Parse separately. |
| 34 const uint8_t kPacket[] = {0x81, 201, 0x00, 0x07, 0x12, 0x34, 0x56, 0x78, | 34 const uint8_t kPacket[] = {0x81, 201, 0x00, 0x07, 0x12, 0x34, 0x56, 0x78, |
| 35 0x23, 0x45, 0x67, 0x89, 55, 0x11, 0x12, 0x13, | 35 0x23, 0x45, 0x67, 0x89, 55, 0x11, 0x12, 0x13, |
| 36 0x22, 0x23, 0x24, 0x25, 0x33, 0x34, 0x35, 0x36, | 36 0x22, 0x23, 0x24, 0x25, 0x33, 0x34, 0x35, 0x36, |
| 37 0x44, 0x45, 0x46, 0x47, 0x55, 0x56, 0x57, 0x58}; | 37 0x44, 0x45, 0x46, 0x47, 0x55, 0x56, 0x57, 0x58}; |
| 38 const size_t kPacketLength = sizeof(kPacket); | 38 const size_t kPacketLength = sizeof(kPacket); |
| 39 | 39 |
| 40 class RtcpPacketReceiverReportTest : public ::testing::Test { | 40 class RtcpPacketReceiverReportTest : public ::testing::Test { |
| 41 protected: | 41 protected: |
| 42 void BuildPacket() { packet = rr.Build().Pass(); } | 42 void BuildPacket() { packet = rr.Build(); } |
| 43 void ParsePacket() { | 43 void ParsePacket() { |
| 44 RtcpCommonHeader header; | 44 RtcpCommonHeader header; |
| 45 EXPECT_TRUE( | 45 EXPECT_TRUE( |
| 46 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); | 46 RtcpParseCommonHeader(packet->Buffer(), packet->Length(), &header)); |
| 47 EXPECT_EQ(header.BlockSize(), packet->Length()); | 47 EXPECT_EQ(header.BlockSize(), packet->Length()); |
| 48 EXPECT_TRUE(parsed_.Parse( | 48 EXPECT_TRUE(parsed_.Parse( |
| 49 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); | 49 header, packet->Buffer() + RtcpCommonHeader::kHeaderSizeBytes)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 ReceiverReport rr; | 52 ReceiverReport rr; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 for (size_t i = 0; i < kMaxReportBlocks; ++i) { | 136 for (size_t i = 0; i < kMaxReportBlocks; ++i) { |
| 137 rb.To(kRemoteSsrc + i); | 137 rb.To(kRemoteSsrc + i); |
| 138 EXPECT_TRUE(rr.WithReportBlock(rb)); | 138 EXPECT_TRUE(rr.WithReportBlock(rb)); |
| 139 } | 139 } |
| 140 rb.To(kRemoteSsrc + kMaxReportBlocks); | 140 rb.To(kRemoteSsrc + kMaxReportBlocks); |
| 141 EXPECT_FALSE(rr.WithReportBlock(rb)); | 141 EXPECT_FALSE(rr.WithReportBlock(rb)); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 } // namespace webrtc | 145 } // namespace webrtc |
| OLD | NEW |