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

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

Issue 1924443002: Revert of Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months 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 #include <memory>
12
13 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
15 13
16 #include "webrtc/common_types.h" 14 #include "webrtc/common_types.h"
17 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra te_observer.h" 15 #include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitra te_observer.h"
18 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl e_stream.h" 16 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl e_stream.h"
19 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 17 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
20 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" 18 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
21 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" 19 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h"
22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" 20 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return 0; 138 return 0;
141 } 139 }
142 140
143 OverUseDetectorOptions over_use_detector_options_; 141 OverUseDetectorOptions over_use_detector_options_;
144 SimulatedClock system_clock_; 142 SimulatedClock system_clock_;
145 ModuleRtpRtcpImpl* rtp_rtcp_impl_; 143 ModuleRtpRtcpImpl* rtp_rtcp_impl_;
146 RTCPReceiver* rtcp_receiver_; 144 RTCPReceiver* rtcp_receiver_;
147 TestTransport* test_transport_; 145 TestTransport* test_transport_;
148 RTCPHelp::RTCPPacketInformation rtcp_packet_info_; 146 RTCPHelp::RTCPPacketInformation rtcp_packet_info_;
149 MockRemoteBitrateObserver remote_bitrate_observer_; 147 MockRemoteBitrateObserver remote_bitrate_observer_;
150 std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 148 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
151 }; 149 };
152 150
153 151
154 TEST_F(RtcpReceiverTest, BrokenPacketIsIgnored) { 152 TEST_F(RtcpReceiverTest, BrokenPacketIsIgnored) {
155 const uint8_t bad_packet[] = {0, 0, 0, 0}; 153 const uint8_t bad_packet[] = {0, 0, 0, 0};
156 EXPECT_EQ(0, InjectRtcpPacket(bad_packet, sizeof(bad_packet))); 154 EXPECT_EQ(0, InjectRtcpPacket(bad_packet, sizeof(bad_packet)));
157 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags); 155 EXPECT_EQ(0U, rtcp_packet_info_.rtcpPacketTypeFlags);
158 } 156 }
159 157
160 TEST_F(RtcpReceiverTest, InvalidFeedbackPacketIsIgnored) { 158 TEST_F(RtcpReceiverTest, InvalidFeedbackPacketIsIgnored) {
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1287
1290 // Transport feedback should be ignored, but next packet should work. 1288 // Transport feedback should be ignored, but next packet should work.
1291 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1289 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1292 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1290 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1293 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1291 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1294 } 1292 }
1295 1293
1296 } // Anonymous namespace 1294 } // Anonymous namespace
1297 1295
1298 } // namespace webrtc 1296 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698