Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc

Issue 1434213004: rtcp::Ij renamed to rtcp::ExtendedJitterReport and moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 11
12 /* 12 /*
13 * This file includes unit tests for the RTCPReceiver. 13 * This file includes unit tests for the RTCPReceiver.
14 */ 14 */
15 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 // Note: This file has no directory. Lint warning must be ignored. 18 // Note: This file has no directory. Lint warning must be ignored.
19 #include "webrtc/common_types.h" 19 #include "webrtc/common_types.h"
20 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra te_observer.h" 20 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra te_observer.h"
21 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl e_stream.h" 21 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl e_stream.h"
22 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 22 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
24 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h"
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h"
26 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" 26 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
27 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
29 30
30 namespace webrtc { 31 namespace webrtc {
31 32
32 namespace { // Anonymous namespace; hide utility functions and classes. 33 namespace { // Anonymous namespace; hide utility functions and classes.
33 34
34 // This test transport verifies that no functions get called. 35 // This test transport verifies that no functions get called.
35 class TestTransport : public Transport, 36 class TestTransport : public Transport,
36 public NullRtpData { 37 public NullRtpData {
37 public: 38 public:
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 EXPECT_EQ(1u, rtcp_packet_info_.report_blocks.size()); 378 EXPECT_EQ(1u, rtcp_packet_info_.report_blocks.size());
378 EXPECT_EQ( 379 EXPECT_EQ(
379 0, rtcp_receiver_->RTT(kSenderSsrc, nullptr, nullptr, nullptr, nullptr)); 380 0, rtcp_receiver_->RTT(kSenderSsrc, nullptr, nullptr, nullptr, nullptr));
380 381
381 // Report block not received. 382 // Report block not received.
382 EXPECT_EQ(-1, rtcp_receiver_->RTT(kSenderSsrc + 1, nullptr, nullptr, nullptr, 383 EXPECT_EQ(-1, rtcp_receiver_->RTT(kSenderSsrc + 1, nullptr, nullptr, nullptr,
383 nullptr)); 384 nullptr));
384 } 385 }
385 386
386 TEST_F(RtcpReceiverTest, InjectIjWithNoItem) { 387 TEST_F(RtcpReceiverTest, InjectIjWithNoItem) {
387 rtcp::Ij ij; 388 rtcp::ExtendedJitterReport ij;
388 rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build()); 389 rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build());
389 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 390 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
390 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags); 391 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
391 } 392 }
392 393
393 TEST_F(RtcpReceiverTest, InjectIjWithOneItem) { 394 TEST_F(RtcpReceiverTest, InjectIjWithOneItem) {
394 rtcp::Ij ij; 395 rtcp::ExtendedJitterReport ij;
395 ij.WithJitterItem(0x11111111); 396 ij.WithJitter(0x11213141);
396 397
397 rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build()); 398 rtc::scoped_ptr<rtcp::RawPacket> packet(ij.Build());
398 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length())); 399 EXPECT_EQ(0, InjectRtcpPacket(packet->Buffer(), packet->Length()));
399 EXPECT_EQ(kRtcpTransmissionTimeOffset, rtcp_packet_info_.rtcpPacketTypeFlags); 400 EXPECT_EQ(kRtcpTransmissionTimeOffset, rtcp_packet_info_.rtcpPacketTypeFlags);
400 EXPECT_EQ(0x11111111U, rtcp_packet_info_.interArrivalJitter); 401 EXPECT_EQ(0x11213141U, rtcp_packet_info_.interArrivalJitter);
401 } 402 }
402 403
403 TEST_F(RtcpReceiverTest, InjectAppWithNoData) { 404 TEST_F(RtcpReceiverTest, InjectAppWithNoData) {
404 rtcp::App app; 405 rtcp::App app;
405 app.WithSubType(30); 406 app.WithSubType(30);
406 uint32_t name = 'n' << 24; 407 uint32_t name = 'n' << 24;
407 name += 'a' << 16; 408 name += 'a' << 16;
408 name += 'm' << 8; 409 name += 'm' << 8;
409 name += 'e'; 410 name += 'e';
410 app.WithName(name); 411 app.WithName(name);
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1089
1089 // Transport feedback should be ignored, but next packet should work. 1090 // Transport feedback should be ignored, but next packet should work.
1090 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1091 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1091 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1092 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1092 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1093 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1093 } 1094 }
1094 1095
1095 } // Anonymous namespace 1096 } // Anonymous namespace
1096 1097
1097 } // namespace webrtc 1098 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698