OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 EXPECT_EQ(1, parser()->app()->num_packets()); | 382 EXPECT_EQ(1, parser()->app()->num_packets()); |
383 EXPECT_EQ(kSubType, parser()->app()->SubType()); | 383 EXPECT_EQ(kSubType, parser()->app()->SubType()); |
384 EXPECT_EQ(name, parser()->app()->Name()); | 384 EXPECT_EQ(name, parser()->app()->Name()); |
385 EXPECT_EQ(1, parser()->app_item()->num_packets()); | 385 EXPECT_EQ(1, parser()->app_item()->num_packets()); |
386 EXPECT_EQ(kDataLength, parser()->app_item()->DataLength()); | 386 EXPECT_EQ(kDataLength, parser()->app_item()->DataLength()); |
387 EXPECT_EQ(0, strncmp(reinterpret_cast<const char*>(kData), | 387 EXPECT_EQ(0, strncmp(reinterpret_cast<const char*>(kData), |
388 reinterpret_cast<const char*>(parser()->app_item()->Data()), | 388 reinterpret_cast<const char*>(parser()->app_item()->Data()), |
389 parser()->app_item()->DataLength())); | 389 parser()->app_item()->DataLength())); |
390 } | 390 } |
391 | 391 |
| 392 TEST_F(RtcpSenderTest, SendEmptyApp) { |
| 393 const uint8_t kSubType = 30; |
| 394 const uint32_t kName = 0x6E616D65; |
| 395 |
| 396 EXPECT_EQ( |
| 397 0, rtcp_sender_->SetApplicationSpecificData(kSubType, kName, nullptr, 0)); |
| 398 |
| 399 rtcp_sender_->SetRTCPStatus(kRtcpNonCompound); |
| 400 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpApp)); |
| 401 EXPECT_EQ(1, parser()->app()->num_packets()); |
| 402 EXPECT_EQ(kSubType, parser()->app()->SubType()); |
| 403 EXPECT_EQ(kName, parser()->app()->Name()); |
| 404 EXPECT_EQ(0, parser()->app_item()->num_packets()); |
| 405 } |
| 406 |
392 TEST_F(RtcpSenderTest, SetInvalidApplicationSpecificData) { | 407 TEST_F(RtcpSenderTest, SetInvalidApplicationSpecificData) { |
393 const uint8_t kData[] = {'t', 'e', 's', 't', 'd', 'a', 't'}; | 408 const uint8_t kData[] = {'t', 'e', 's', 't', 'd', 'a', 't'}; |
394 const uint16_t kInvalidDataLength = sizeof(kData) / sizeof(kData[0]); | 409 const uint16_t kInvalidDataLength = sizeof(kData) / sizeof(kData[0]); |
395 EXPECT_EQ(-1, rtcp_sender_->SetApplicationSpecificData( | 410 EXPECT_EQ(-1, rtcp_sender_->SetApplicationSpecificData( |
396 0, 0, kData, kInvalidDataLength)); // Should by multiple of 4. | 411 0, 0, kData, kInvalidDataLength)); // Should by multiple of 4. |
397 } | 412 } |
398 | 413 |
399 TEST_F(RtcpSenderTest, SendFirNonRepeat) { | 414 TEST_F(RtcpSenderTest, SendFirNonRepeat) { |
400 rtcp_sender_->SetRTCPStatus(kRtcpNonCompound); | 415 rtcp_sender_->SetRTCPStatus(kRtcpNonCompound); |
401 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpFir)); | 416 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpFir)); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 rtcp_sender_->SetREMBData(kBitrate, ssrcs); | 756 rtcp_sender_->SetREMBData(kBitrate, ssrcs); |
742 std::set<RTCPPacketType> packet_types; | 757 std::set<RTCPPacketType> packet_types; |
743 packet_types.insert(kRtcpRemb); | 758 packet_types.insert(kRtcpRemb); |
744 packet_types.insert(kRtcpPli); | 759 packet_types.insert(kRtcpPli); |
745 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types)); | 760 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types)); |
746 EXPECT_EQ(1, parser()->remb_item()->num_packets()); | 761 EXPECT_EQ(1, parser()->remb_item()->num_packets()); |
747 EXPECT_EQ(1, parser()->pli()->num_packets()); | 762 EXPECT_EQ(1, parser()->pli()->num_packets()); |
748 } | 763 } |
749 | 764 |
750 } // namespace webrtc | 765 } // namespace webrtc |
OLD | NEW |