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 name = 0x6E616D65; | |
åsapersson
2015/08/31 14:32:52
kName
sprang_webrtc
2015/08/31 15:29:28
Done.
| |
395 | |
396 EXPECT_EQ( | |
397 0, rtcp_sender_->SetApplicationSpecificData(kSubType, name, 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(name, parser()->app()->Name()); | |
åsapersson
2015/08/31 14:32:52
maybe check that there is no app_item
sprang_webrtc
2015/08/31 15:29:28
Done.
| |
404 } | |
405 | |
392 TEST_F(RtcpSenderTest, SetInvalidApplicationSpecificData) { | 406 TEST_F(RtcpSenderTest, SetInvalidApplicationSpecificData) { |
393 const uint8_t kData[] = {'t', 'e', 's', 't', 'd', 'a', 't'}; | 407 const uint8_t kData[] = {'t', 'e', 's', 't', 'd', 'a', 't'}; |
394 const uint16_t kInvalidDataLength = sizeof(kData) / sizeof(kData[0]); | 408 const uint16_t kInvalidDataLength = sizeof(kData) / sizeof(kData[0]); |
395 EXPECT_EQ(-1, rtcp_sender_->SetApplicationSpecificData( | 409 EXPECT_EQ(-1, rtcp_sender_->SetApplicationSpecificData( |
396 0, 0, kData, kInvalidDataLength)); // Should by multiple of 4. | 410 0, 0, kData, kInvalidDataLength)); // Should by multiple of 4. |
397 } | 411 } |
398 | 412 |
399 TEST_F(RtcpSenderTest, SendFirNonRepeat) { | 413 TEST_F(RtcpSenderTest, SendFirNonRepeat) { |
400 rtcp_sender_->SetRTCPStatus(kRtcpNonCompound); | 414 rtcp_sender_->SetRTCPStatus(kRtcpNonCompound); |
401 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpFir)); | 415 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); | 755 rtcp_sender_->SetREMBData(kBitrate, ssrcs); |
742 std::set<RTCPPacketType> packet_types; | 756 std::set<RTCPPacketType> packet_types; |
743 packet_types.insert(kRtcpRemb); | 757 packet_types.insert(kRtcpRemb); |
744 packet_types.insert(kRtcpPli); | 758 packet_types.insert(kRtcpPli); |
745 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types)); | 759 EXPECT_EQ(0, rtcp_sender_->SendCompoundRTCP(feedback_state(), packet_types)); |
746 EXPECT_EQ(1, parser()->remb_item()->num_packets()); | 760 EXPECT_EQ(1, parser()->remb_item()->num_packets()); |
747 EXPECT_EQ(1, parser()->pli()->num_packets()); | 761 EXPECT_EQ(1, parser()->pli()->num_packets()); |
748 } | 762 } |
749 | 763 |
750 } // namespace webrtc | 764 } // namespace webrtc |
OLD | NEW |