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 |
11 | 11 |
12 /* | 12 /* |
13 * This file includes unit tests for the RTCPSender. | 13 * This file includes unit tests for the RTCPSender. |
14 */ | 14 */ |
15 | 15 |
16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
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/include/remote_bitrate_estimat
or.h" | 21 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
22 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" | 22 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
23 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" | 23 #include "webrtc/modules/rtp_rtcp/interface/rtp_payload_registry.h" |
24 #include "webrtc/modules/rtp_rtcp/interface/rtp_receiver.h" | 24 #include "webrtc/modules/rtp_rtcp/interface/rtp_receiver.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
27 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" |
28 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" |
29 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 RTCPHelp::RTCPPacketInformation rtcp_packet_info_; | 272 RTCPHelp::RTCPPacketInformation rtcp_packet_info_; |
273 }; | 273 }; |
274 | 274 |
275 class RtcpSenderTest : public ::testing::Test { | 275 class RtcpSenderTest : public ::testing::Test { |
276 protected: | 276 protected: |
277 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; | 277 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; |
278 | 278 |
279 RtcpSenderTest() | 279 RtcpSenderTest() |
280 : over_use_detector_options_(), | 280 : over_use_detector_options_(), |
281 clock_(1335900000), | 281 clock_(1335900000), |
282 rtp_payload_registry_(new RTPPayloadRegistry( | 282 rtp_payload_registry_( |
283 RTPPayloadStrategy::CreateStrategy(false))), | 283 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(false))), |
284 remote_bitrate_observer_(), | 284 remote_bitrate_observer_(), |
285 remote_bitrate_estimator_( | 285 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream( |
286 RemoteBitrateEstimatorFactory().Create( | 286 &remote_bitrate_observer_, |
287 &remote_bitrate_observer_, | 287 &clock_, |
288 &clock_, | 288 kRemoteBitrateEstimatorMinBitrateBps)), |
289 kMimdControl, | |
290 kRemoteBitrateEstimatorMinBitrateBps)), | |
291 receive_statistics_(ReceiveStatistics::Create(&clock_)) { | 289 receive_statistics_(ReceiveStatistics::Create(&clock_)) { |
292 test_transport_ = new TestTransport(); | 290 test_transport_ = new TestTransport(); |
293 | 291 |
294 RtpRtcp::Configuration configuration; | 292 RtpRtcp::Configuration configuration; |
295 configuration.id = 0; | 293 configuration.id = 0; |
296 configuration.audio = false; | 294 configuration.audio = false; |
297 configuration.clock = &clock_; | 295 configuration.clock = &clock_; |
298 configuration.outgoing_transport = test_transport_; | 296 configuration.outgoing_transport = test_transport_; |
299 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); | 297 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); |
300 | 298 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 ASSERT_NE(0U, test_transport_->rtcp_packet_info_.rtcpPacketTypeFlags); | 506 ASSERT_NE(0U, test_transport_->rtcp_packet_info_.rtcpPacketTypeFlags); |
509 EXPECT_TRUE(gotPacketType(kRtcpTmmbn)); | 507 EXPECT_TRUE(gotPacketType(kRtcpTmmbn)); |
510 TMMBRSet incoming_set; | 508 TMMBRSet incoming_set; |
511 bool owner = false; | 509 bool owner = false; |
512 // We expect 1 member of the incoming set. | 510 // We expect 1 member of the incoming set. |
513 EXPECT_EQ(1, test_transport_->rtcp_receiver_->BoundingSet(owner, | 511 EXPECT_EQ(1, test_transport_->rtcp_receiver_->BoundingSet(owner, |
514 &incoming_set)); | 512 &incoming_set)); |
515 EXPECT_EQ(kSourceSsrc, incoming_set.Ssrc(0)); | 513 EXPECT_EQ(kSourceSsrc, incoming_set.Ssrc(0)); |
516 } | 514 } |
517 } // namespace webrtc | 515 } // namespace webrtc |
OLD | NEW |