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 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/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/source/rtcp_packet.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" |
23 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h" |
24 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" |
25 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" |
26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
27 | 27 |
28 namespace webrtc { | 28 namespace webrtc { |
29 | 29 |
30 namespace { // Anonymous namespace; hide utility functions and classes. | 30 namespace { // Anonymous namespace; hide utility functions and classes. |
31 | 31 |
(...skipping 30 matching lines...) Expand all Loading... |
62 }; | 62 }; |
63 | 63 |
64 class RtcpReceiverTest : public ::testing::Test { | 64 class RtcpReceiverTest : public ::testing::Test { |
65 protected: | 65 protected: |
66 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; | 66 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; |
67 | 67 |
68 RtcpReceiverTest() | 68 RtcpReceiverTest() |
69 : over_use_detector_options_(), | 69 : over_use_detector_options_(), |
70 system_clock_(1335900000), | 70 system_clock_(1335900000), |
71 remote_bitrate_observer_(), | 71 remote_bitrate_observer_(), |
72 remote_bitrate_estimator_( | 72 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream( |
73 RemoteBitrateEstimatorFactory().Create( | 73 &remote_bitrate_observer_, |
74 &remote_bitrate_observer_, | 74 &system_clock_, |
75 &system_clock_, | 75 kRemoteBitrateEstimatorMinBitrateBps)) { |
76 kMimdControl, | |
77 kRemoteBitrateEstimatorMinBitrateBps)) { | |
78 test_transport_ = new TestTransport(); | 76 test_transport_ = new TestTransport(); |
79 | 77 |
80 RtpRtcp::Configuration configuration; | 78 RtpRtcp::Configuration configuration; |
81 configuration.id = 0; | 79 configuration.id = 0; |
82 configuration.audio = false; | 80 configuration.audio = false; |
83 configuration.clock = &system_clock_; | 81 configuration.clock = &system_clock_; |
84 configuration.outgoing_transport = test_transport_; | 82 configuration.outgoing_transport = test_transport_; |
85 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); | 83 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); |
86 rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); | 84 rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); |
87 rtcp_receiver_ = new RTCPReceiver(0, &system_clock_, false, NULL, NULL, | 85 rtcp_receiver_ = new RTCPReceiver(0, &system_clock_, false, NULL, NULL, |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 rr2.WithReportBlock(rb2); | 1027 rr2.WithReportBlock(rb2); |
1030 rtc::scoped_ptr<rtcp::RawPacket> p2(rr2.Build()); | 1028 rtc::scoped_ptr<rtcp::RawPacket> p2(rr2.Build()); |
1031 EXPECT_EQ(0, InjectRtcpPacket(p2->Buffer(), p2->Length())); | 1029 EXPECT_EQ(0, InjectRtcpPacket(p2->Buffer(), p2->Length())); |
1032 EXPECT_TRUE(callback.Matches(kSourceSsrc, kSequenceNumber, kFractionLoss, | 1030 EXPECT_TRUE(callback.Matches(kSourceSsrc, kSequenceNumber, kFractionLoss, |
1033 kCumulativeLoss, kJitter)); | 1031 kCumulativeLoss, kJitter)); |
1034 } | 1032 } |
1035 | 1033 |
1036 } // Anonymous namespace | 1034 } // Anonymous namespace |
1037 | 1035 |
1038 } // namespace webrtc | 1036 } // namespace webrtc |
OLD | NEW |