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

Side by Side Diff: webrtc/pc/channel_unittest.cc

Issue 1920043002: Replace scoped_ptr with unique_ptr in webrtc/base/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased 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 2009 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2009 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 CreateContent(flags1, kPcmuCodec, kH264Codec, 155 CreateContent(flags1, kPcmuCodec, kH264Codec,
156 &local_media_content1_); 156 &local_media_content1_);
157 CreateContent(flags2, kPcmuCodec, kH264Codec, 157 CreateContent(flags2, kPcmuCodec, kH264Codec,
158 &local_media_content2_); 158 &local_media_content2_);
159 CopyContent(local_media_content1_, &remote_media_content1_); 159 CopyContent(local_media_content1_, &remote_media_content1_);
160 CopyContent(local_media_content2_, &remote_media_content2_); 160 CopyContent(local_media_content2_, &remote_media_content2_);
161 161
162 if (flags1 & DTLS) { 162 if (flags1 & DTLS) {
163 // Confirmed to work with KT_RSA and KT_ECDSA. 163 // Confirmed to work with KT_RSA and KT_ECDSA.
164 transport_controller1_.SetLocalCertificate( 164 transport_controller1_.SetLocalCertificate(
165 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( 165 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
166 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT)))); 166 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT))));
167 } 167 }
168 if (flags2 & DTLS) { 168 if (flags2 & DTLS) {
169 // Confirmed to work with KT_RSA and KT_ECDSA. 169 // Confirmed to work with KT_RSA and KT_ECDSA.
170 transport_controller2_.SetLocalCertificate( 170 transport_controller2_.SetLocalCertificate(
171 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( 171 rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
172 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT)))); 172 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT))));
173 } 173 }
174 174
175 // Add stream information (SSRC) to the local content but not to the remote 175 // Add stream information (SSRC) to the local content but not to the remote
176 // content. This means that we per default know the SSRC of what we send but 176 // content. This means that we per default know the SSRC of what we send but
177 // not what we receive. 177 // not what we receive.
178 AddLegacyStreamInContent(kSsrc1, flags1, &local_media_content1_); 178 AddLegacyStreamInContent(kSsrc1, flags1, &local_media_content1_);
179 AddLegacyStreamInContent(kSsrc2, flags2, &local_media_content2_); 179 AddLegacyStreamInContent(kSsrc2, flags2, &local_media_content2_);
180 180
181 // If SSRC_MUX is used we also need to know the SSRC of the incoming stream. 181 // If SSRC_MUX is used we also need to know the SSRC of the incoming stream.
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); 974 EXPECT_EQ(1, media_channel1_->num_network_route_changes());
975 EXPECT_FALSE(media_channel1->last_network_route().connected); 975 EXPECT_FALSE(media_channel1->last_network_route().connected);
976 976
977 media_channel1_->set_num_network_route_changes(0); 977 media_channel1_->set_num_network_route_changes(0);
978 // The transport channel becomes connected. 978 // The transport channel becomes connected.
979 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); 979 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */);
980 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); 980 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */);
981 uint16_t local_net_id = 1; 981 uint16_t local_net_id = 1;
982 uint16_t remote_net_id = 2; 982 uint16_t remote_net_id = 2;
983 int last_packet_id = 100; 983 int last_packet_id = 100;
984 rtc::scoped_ptr<cricket::CandidatePairInterface> candidate_pair( 984 std::unique_ptr<cricket::CandidatePairInterface> candidate_pair(
985 transport_controller1_.CreateFakeCandidatePair( 985 transport_controller1_.CreateFakeCandidatePair(
986 local_address, local_net_id, remote_address, remote_net_id)); 986 local_address, local_net_id, remote_address, remote_net_id));
987 transport_channel1->SignalSelectedCandidatePairChanged( 987 transport_channel1->SignalSelectedCandidatePairChanged(
988 transport_channel1, candidate_pair.get(), last_packet_id); 988 transport_channel1, candidate_pair.get(), last_packet_id);
989 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); 989 EXPECT_EQ(1, media_channel1_->num_network_route_changes());
990 rtc::NetworkRoute expected_network_route(local_net_id, remote_net_id, 990 rtc::NetworkRoute expected_network_route(local_net_id, remote_net_id,
991 last_packet_id); 991 last_packet_id);
992 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); 992 EXPECT_EQ(expected_network_route, media_channel1->last_network_route());
993 EXPECT_EQ(last_packet_id, 993 EXPECT_EQ(last_packet_id,
994 media_channel1->last_network_route().last_sent_packet_id); 994 media_channel1->last_network_route().last_sent_packet_id);
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 }; 2810 };
2811 rtc::CopyOnWriteBuffer payload(data, 3); 2811 rtc::CopyOnWriteBuffer payload(data, 3);
2812 cricket::SendDataResult result; 2812 cricket::SendDataResult result;
2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2813 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2814 EXPECT_EQ(params.ssrc, 2814 EXPECT_EQ(params.ssrc,
2815 media_channel1_->last_sent_data_params().ssrc); 2815 media_channel1_->last_sent_data_params().ssrc);
2816 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2816 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2817 } 2817 }
2818 2818
2819 // TODO(pthatcher): TestSetReceiver? 2819 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transportdescriptionfactory_unittest.cc ('k') | webrtc/pc/mediasession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698