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

Side by Side Diff: talk/app/webrtc/peerconnectionfactory_unittest.cc

Issue 1460043002: Don't call the Pass methods of rtc::Buffer, rtc::scoped_ptr, and rtc::ScopedVector (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Restore the Pass methods Created 5 years 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
« no previous file with comments | « talk/app/webrtc/peerconnectionfactory.cc ('k') | talk/app/webrtc/peerconnectionfactoryproxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation 11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution. 12 * and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products 13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission. 14 * derived from this software without specific prior written permission.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include <string> 28 #include <string>
29 #include <utility>
29 30
30 #include "talk/app/webrtc/fakeportallocatorfactory.h" 31 #include "talk/app/webrtc/fakeportallocatorfactory.h"
31 #include "talk/app/webrtc/mediastreaminterface.h" 32 #include "talk/app/webrtc/mediastreaminterface.h"
32 #include "talk/app/webrtc/peerconnectionfactory.h" 33 #include "talk/app/webrtc/peerconnectionfactory.h"
33 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" 34 #include "talk/app/webrtc/test/fakedtlsidentitystore.h"
34 #include "talk/app/webrtc/test/fakevideotrackrenderer.h" 35 #include "talk/app/webrtc/test/fakevideotrackrenderer.h"
35 #include "talk/app/webrtc/videosourceinterface.h" 36 #include "talk/app/webrtc/videosourceinterface.h"
36 #include "talk/media/base/fakevideocapturer.h" 37 #include "talk/media/base/fakevideocapturer.h"
37 #include "talk/media/webrtc/webrtccommon.h" 38 #include "talk/media/webrtc/webrtccommon.h"
38 #include "talk/media/webrtc/webrtcvoe.h" 39 #include "talk/media/webrtc/webrtcvoe.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // internal libjingle threads. 152 // internal libjingle threads.
152 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) { 153 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) {
153 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( 154 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
154 webrtc::CreatePeerConnectionFactory()); 155 webrtc::CreatePeerConnectionFactory());
155 156
156 NullPeerConnectionObserver observer; 157 NullPeerConnectionObserver observer;
157 webrtc::PeerConnectionInterface::IceServers servers; 158 webrtc::PeerConnectionInterface::IceServers servers;
158 159
159 rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store( 160 rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store(
160 new FakeDtlsIdentityStore()); 161 new FakeDtlsIdentityStore());
161 rtc::scoped_refptr<PeerConnectionInterface> pc( 162 rtc::scoped_refptr<PeerConnectionInterface> pc(factory->CreatePeerConnection(
162 factory->CreatePeerConnection( 163 servers, nullptr, nullptr, std::move(dtls_identity_store), &observer));
163 servers, nullptr, nullptr, dtls_identity_store.Pass(), &observer));
164 164
165 EXPECT_TRUE(pc.get() != nullptr); 165 EXPECT_TRUE(pc.get() != nullptr);
166 } 166 }
167 167
168 // This test verifies creation of PeerConnection with valid STUN and TURN 168 // This test verifies creation of PeerConnection with valid STUN and TURN
169 // configuration. Also verifies the URL's parsed correctly as expected. 169 // configuration. Also verifies the URL's parsed correctly as expected.
170 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { 170 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
171 PeerConnectionInterface::RTCConfiguration config; 171 PeerConnectionInterface::RTCConfiguration config;
172 webrtc::PeerConnectionInterface::IceServer ice_server; 172 webrtc::PeerConnectionInterface::IceServer ice_server;
173 ice_server.uri = kStunIceServer; 173 ice_server.uri = kStunIceServer;
174 config.servers.push_back(ice_server); 174 config.servers.push_back(ice_server);
175 ice_server.uri = kTurnIceServer; 175 ice_server.uri = kTurnIceServer;
176 ice_server.password = kTurnPassword; 176 ice_server.password = kTurnPassword;
177 config.servers.push_back(ice_server); 177 config.servers.push_back(ice_server);
178 ice_server.uri = kTurnIceServerWithTransport; 178 ice_server.uri = kTurnIceServerWithTransport;
179 ice_server.password = kTurnPassword; 179 ice_server.password = kTurnPassword;
180 config.servers.push_back(ice_server); 180 config.servers.push_back(ice_server);
181 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 181 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
182 new FakeDtlsIdentityStore()); 182 new FakeDtlsIdentityStore());
183 rtc::scoped_refptr<PeerConnectionInterface> pc( 183 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
184 factory_->CreatePeerConnection(config, nullptr, 184 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
185 allocator_factory_.get(), 185 &observer_));
186 dtls_identity_store.Pass(),
187 &observer_));
188 EXPECT_TRUE(pc.get() != NULL); 186 EXPECT_TRUE(pc.get() != NULL);
189 StunConfigurations stun_configs; 187 StunConfigurations stun_configs;
190 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 188 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
191 "stun.l.google.com", 19302); 189 "stun.l.google.com", 19302);
192 stun_configs.push_back(stun1); 190 stun_configs.push_back(stun1);
193 VerifyStunConfigurations(stun_configs); 191 VerifyStunConfigurations(stun_configs);
194 TurnConfigurations turn_configs; 192 TurnConfigurations turn_configs;
195 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 193 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
196 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); 194 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false);
197 turn_configs.push_back(turn1); 195 turn_configs.push_back(turn1);
198 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( 196 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2(
199 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); 197 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false);
200 turn_configs.push_back(turn2); 198 turn_configs.push_back(turn2);
201 VerifyTurnConfigurations(turn_configs); 199 VerifyTurnConfigurations(turn_configs);
202 } 200 }
203 201
204 // This test verifies creation of PeerConnection with valid STUN and TURN 202 // This test verifies creation of PeerConnection with valid STUN and TURN
205 // configuration. Also verifies the list of URL's parsed correctly as expected. 203 // configuration. Also verifies the list of URL's parsed correctly as expected.
206 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) { 204 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) {
207 PeerConnectionInterface::RTCConfiguration config; 205 PeerConnectionInterface::RTCConfiguration config;
208 webrtc::PeerConnectionInterface::IceServer ice_server; 206 webrtc::PeerConnectionInterface::IceServer ice_server;
209 ice_server.urls.push_back(kStunIceServer); 207 ice_server.urls.push_back(kStunIceServer);
210 ice_server.urls.push_back(kTurnIceServer); 208 ice_server.urls.push_back(kTurnIceServer);
211 ice_server.urls.push_back(kTurnIceServerWithTransport); 209 ice_server.urls.push_back(kTurnIceServerWithTransport);
212 ice_server.password = kTurnPassword; 210 ice_server.password = kTurnPassword;
213 config.servers.push_back(ice_server); 211 config.servers.push_back(ice_server);
214 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 212 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
215 new FakeDtlsIdentityStore()); 213 new FakeDtlsIdentityStore());
216 rtc::scoped_refptr<PeerConnectionInterface> pc( 214 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
217 factory_->CreatePeerConnection(config, nullptr, 215 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
218 allocator_factory_.get(), 216 &observer_));
219 dtls_identity_store.Pass(),
220 &observer_));
221 EXPECT_TRUE(pc.get() != NULL); 217 EXPECT_TRUE(pc.get() != NULL);
222 StunConfigurations stun_configs; 218 StunConfigurations stun_configs;
223 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 219 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
224 "stun.l.google.com", 19302); 220 "stun.l.google.com", 19302);
225 stun_configs.push_back(stun1); 221 stun_configs.push_back(stun1);
226 VerifyStunConfigurations(stun_configs); 222 VerifyStunConfigurations(stun_configs);
227 TurnConfigurations turn_configs; 223 TurnConfigurations turn_configs;
228 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 224 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
229 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); 225 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false);
230 turn_configs.push_back(turn1); 226 turn_configs.push_back(turn1);
(...skipping 13 matching lines...) Expand all
244 ice_server.uri = kStunIceServer; 240 ice_server.uri = kStunIceServer;
245 ice_servers.push_back(ice_server); 241 ice_servers.push_back(ice_server);
246 ice_server.uri = kTurnIceServer; 242 ice_server.uri = kTurnIceServer;
247 ice_server.password = kTurnPassword; 243 ice_server.password = kTurnPassword;
248 ice_servers.push_back(ice_server); 244 ice_servers.push_back(ice_server);
249 ice_server.uri = kTurnIceServerWithTransport; 245 ice_server.uri = kTurnIceServerWithTransport;
250 ice_server.password = kTurnPassword; 246 ice_server.password = kTurnPassword;
251 ice_servers.push_back(ice_server); 247 ice_servers.push_back(ice_server);
252 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 248 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
253 new FakeDtlsIdentityStore()); 249 new FakeDtlsIdentityStore());
254 rtc::scoped_refptr<PeerConnectionInterface> pc( 250 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
255 factory_->CreatePeerConnection(ice_servers, nullptr, 251 ice_servers, nullptr, allocator_factory_.get(),
256 allocator_factory_.get(), 252 std::move(dtls_identity_store), &observer_));
257 dtls_identity_store.Pass(),
258 &observer_));
259 EXPECT_TRUE(pc.get() != NULL); 253 EXPECT_TRUE(pc.get() != NULL);
260 StunConfigurations stun_configs; 254 StunConfigurations stun_configs;
261 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 255 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
262 "stun.l.google.com", 19302); 256 "stun.l.google.com", 19302);
263 stun_configs.push_back(stun1); 257 stun_configs.push_back(stun1);
264 VerifyStunConfigurations(stun_configs); 258 VerifyStunConfigurations(stun_configs);
265 TurnConfigurations turn_configs; 259 TurnConfigurations turn_configs;
266 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 260 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
267 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); 261 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false);
268 turn_configs.push_back(turn1); 262 turn_configs.push_back(turn1);
269 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( 263 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2(
270 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); 264 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false);
271 turn_configs.push_back(turn2); 265 turn_configs.push_back(turn2);
272 VerifyTurnConfigurations(turn_configs); 266 VerifyTurnConfigurations(turn_configs);
273 } 267 }
274 268
275 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { 269 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) {
276 PeerConnectionInterface::RTCConfiguration config; 270 PeerConnectionInterface::RTCConfiguration config;
277 webrtc::PeerConnectionInterface::IceServer ice_server; 271 webrtc::PeerConnectionInterface::IceServer ice_server;
278 ice_server.uri = kStunIceServer; 272 ice_server.uri = kStunIceServer;
279 config.servers.push_back(ice_server); 273 config.servers.push_back(ice_server);
280 ice_server.uri = kTurnIceServerWithNoUsernameInUri; 274 ice_server.uri = kTurnIceServerWithNoUsernameInUri;
281 ice_server.username = kTurnUsername; 275 ice_server.username = kTurnUsername;
282 ice_server.password = kTurnPassword; 276 ice_server.password = kTurnPassword;
283 config.servers.push_back(ice_server); 277 config.servers.push_back(ice_server);
284 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 278 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
285 new FakeDtlsIdentityStore()); 279 new FakeDtlsIdentityStore());
286 rtc::scoped_refptr<PeerConnectionInterface> pc( 280 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
287 factory_->CreatePeerConnection(config, nullptr, 281 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
288 allocator_factory_.get(), 282 &observer_));
289 dtls_identity_store.Pass(),
290 &observer_));
291 EXPECT_TRUE(pc.get() != NULL); 283 EXPECT_TRUE(pc.get() != NULL);
292 TurnConfigurations turn_configs; 284 TurnConfigurations turn_configs;
293 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( 285 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
294 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false); 286 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false);
295 turn_configs.push_back(turn); 287 turn_configs.push_back(turn);
296 VerifyTurnConfigurations(turn_configs); 288 VerifyTurnConfigurations(turn_configs);
297 } 289 }
298 290
299 // This test verifies the PeerConnection created properly with TURN url which 291 // This test verifies the PeerConnection created properly with TURN url which
300 // has transport parameter in it. 292 // has transport parameter in it.
301 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { 293 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) {
302 PeerConnectionInterface::RTCConfiguration config; 294 PeerConnectionInterface::RTCConfiguration config;
303 webrtc::PeerConnectionInterface::IceServer ice_server; 295 webrtc::PeerConnectionInterface::IceServer ice_server;
304 ice_server.uri = kTurnIceServerWithTransport; 296 ice_server.uri = kTurnIceServerWithTransport;
305 ice_server.password = kTurnPassword; 297 ice_server.password = kTurnPassword;
306 config.servers.push_back(ice_server); 298 config.servers.push_back(ice_server);
307 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 299 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
308 new FakeDtlsIdentityStore()); 300 new FakeDtlsIdentityStore());
309 rtc::scoped_refptr<PeerConnectionInterface> pc( 301 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
310 factory_->CreatePeerConnection(config, nullptr, 302 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
311 allocator_factory_.get(), 303 &observer_));
312 dtls_identity_store.Pass(),
313 &observer_));
314 EXPECT_TRUE(pc.get() != NULL); 304 EXPECT_TRUE(pc.get() != NULL);
315 TurnConfigurations turn_configs; 305 TurnConfigurations turn_configs;
316 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( 306 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
317 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); 307 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false);
318 turn_configs.push_back(turn); 308 turn_configs.push_back(turn);
319 VerifyTurnConfigurations(turn_configs); 309 VerifyTurnConfigurations(turn_configs);
320 } 310 }
321 311
322 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { 312 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) {
323 PeerConnectionInterface::RTCConfiguration config; 313 PeerConnectionInterface::RTCConfiguration config;
324 webrtc::PeerConnectionInterface::IceServer ice_server; 314 webrtc::PeerConnectionInterface::IceServer ice_server;
325 ice_server.uri = kSecureTurnIceServer; 315 ice_server.uri = kSecureTurnIceServer;
326 ice_server.password = kTurnPassword; 316 ice_server.password = kTurnPassword;
327 config.servers.push_back(ice_server); 317 config.servers.push_back(ice_server);
328 ice_server.uri = kSecureTurnIceServerWithoutTransportParam; 318 ice_server.uri = kSecureTurnIceServerWithoutTransportParam;
329 ice_server.password = kTurnPassword; 319 ice_server.password = kTurnPassword;
330 config.servers.push_back(ice_server); 320 config.servers.push_back(ice_server);
331 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; 321 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam;
332 ice_server.password = kTurnPassword; 322 ice_server.password = kTurnPassword;
333 config.servers.push_back(ice_server); 323 config.servers.push_back(ice_server);
334 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 324 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
335 new FakeDtlsIdentityStore()); 325 new FakeDtlsIdentityStore());
336 rtc::scoped_refptr<PeerConnectionInterface> pc( 326 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
337 factory_->CreatePeerConnection(config, nullptr, 327 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
338 allocator_factory_.get(), 328 &observer_));
339 dtls_identity_store.Pass(),
340 &observer_));
341 EXPECT_TRUE(pc.get() != NULL); 329 EXPECT_TRUE(pc.get() != NULL);
342 TurnConfigurations turn_configs; 330 TurnConfigurations turn_configs;
343 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 331 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
344 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true); 332 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true);
345 turn_configs.push_back(turn1); 333 turn_configs.push_back(turn1);
346 // TURNS with transport param should be default to tcp. 334 // TURNS with transport param should be default to tcp.
347 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( 335 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2(
348 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true); 336 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true);
349 turn_configs.push_back(turn2); 337 turn_configs.push_back(turn2);
350 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn3( 338 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn3(
(...skipping 12 matching lines...) Expand all
363 config.servers.push_back(ice_server); 351 config.servers.push_back(ice_server);
364 ice_server.uri = kStunIceServerWithIPv6Address; 352 ice_server.uri = kStunIceServerWithIPv6Address;
365 config.servers.push_back(ice_server); 353 config.servers.push_back(ice_server);
366 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; 354 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort;
367 config.servers.push_back(ice_server); 355 config.servers.push_back(ice_server);
368 ice_server.uri = kTurnIceServerWithIPv6Address; 356 ice_server.uri = kTurnIceServerWithIPv6Address;
369 ice_server.password = kTurnPassword; 357 ice_server.password = kTurnPassword;
370 config.servers.push_back(ice_server); 358 config.servers.push_back(ice_server);
371 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( 359 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
372 new FakeDtlsIdentityStore()); 360 new FakeDtlsIdentityStore());
373 rtc::scoped_refptr<PeerConnectionInterface> pc( 361 rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
374 factory_->CreatePeerConnection(config, nullptr, 362 config, nullptr, allocator_factory_.get(), std::move(dtls_identity_store),
375 allocator_factory_.get(), 363 &observer_));
376 dtls_identity_store.Pass(),
377 &observer_));
378 EXPECT_TRUE(pc.get() != NULL); 364 EXPECT_TRUE(pc.get() != NULL);
379 StunConfigurations stun_configs; 365 StunConfigurations stun_configs;
380 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 366 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
381 "1.2.3.4", 1234); 367 "1.2.3.4", 1234);
382 stun_configs.push_back(stun1); 368 stun_configs.push_back(stun1);
383 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2( 369 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2(
384 "1.2.3.4", 3478); 370 "1.2.3.4", 3478);
385 stun_configs.push_back(stun2); // Default port 371 stun_configs.push_back(stun2); // Default port
386 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3( 372 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3(
387 "2401:fa00:4::", 1234); 373 "2401:fa00:4::", 1234);
(...skipping 29 matching lines...) Expand all
417 403
418 track->set_enabled(false); 404 track->set_enabled(false);
419 EXPECT_TRUE(capturer->CaptureFrame()); 405 EXPECT_TRUE(capturer->CaptureFrame());
420 EXPECT_EQ(1, local_renderer.num_rendered_frames()); 406 EXPECT_EQ(1, local_renderer.num_rendered_frames());
421 407
422 track->set_enabled(true); 408 track->set_enabled(true);
423 EXPECT_TRUE(capturer->CaptureFrame()); 409 EXPECT_TRUE(capturer->CaptureFrame());
424 EXPECT_EQ(2, local_renderer.num_rendered_frames()); 410 EXPECT_EQ(2, local_renderer.num_rendered_frames());
425 } 411 }
426 412
OLDNEW
« no previous file with comments | « talk/app/webrtc/peerconnectionfactory.cc ('k') | talk/app/webrtc/peerconnectionfactoryproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698