OLD | NEW |
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, |
(...skipping 12 matching lines...) Expand all Loading... |
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 | 29 |
30 #include "talk/app/webrtc/fakeportallocatorfactory.h" | 30 #include "talk/app/webrtc/fakeportallocatorfactory.h" |
31 #include "talk/app/webrtc/mediastreaminterface.h" | 31 #include "talk/app/webrtc/mediastreaminterface.h" |
32 #include "talk/app/webrtc/peerconnectionfactory.h" | 32 #include "talk/app/webrtc/peerconnectionfactory.h" |
33 #include "talk/app/webrtc/test/fakedtlsidentityservice.h" | 33 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
34 #include "talk/app/webrtc/test/fakevideotrackrenderer.h" | 34 #include "talk/app/webrtc/test/fakevideotrackrenderer.h" |
35 #include "talk/app/webrtc/videosourceinterface.h" | 35 #include "talk/app/webrtc/videosourceinterface.h" |
36 #include "talk/media/base/fakevideocapturer.h" | 36 #include "talk/media/base/fakevideocapturer.h" |
37 #include "talk/media/webrtc/webrtccommon.h" | 37 #include "talk/media/webrtc/webrtccommon.h" |
38 #include "talk/media/webrtc/webrtcvoe.h" | 38 #include "talk/media/webrtc/webrtcvoe.h" |
39 #include "webrtc/base/gunit.h" | 39 #include "webrtc/base/gunit.h" |
40 #include "webrtc/base/scoped_ptr.h" | 40 #include "webrtc/base/scoped_ptr.h" |
41 #include "webrtc/base/thread.h" | 41 #include "webrtc/base/thread.h" |
42 | 42 |
| 43 using webrtc::DataChannelInterface; |
| 44 using webrtc::DtlsIdentityStoreInterface; |
43 using webrtc::FakeVideoTrackRenderer; | 45 using webrtc::FakeVideoTrackRenderer; |
44 using webrtc::DataChannelInterface; | |
45 using webrtc::MediaStreamInterface; | 46 using webrtc::MediaStreamInterface; |
46 using webrtc::PeerConnectionFactoryInterface; | 47 using webrtc::PeerConnectionFactoryInterface; |
47 using webrtc::PeerConnectionInterface; | 48 using webrtc::PeerConnectionInterface; |
48 using webrtc::PeerConnectionObserver; | 49 using webrtc::PeerConnectionObserver; |
49 using webrtc::PortAllocatorFactoryInterface; | 50 using webrtc::PortAllocatorFactoryInterface; |
50 using webrtc::VideoSourceInterface; | 51 using webrtc::VideoSourceInterface; |
51 using webrtc::VideoTrackInterface; | 52 using webrtc::VideoTrackInterface; |
52 | 53 |
53 namespace { | 54 namespace { |
54 | 55 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 151 |
151 // Verify creation of PeerConnection using internal ADM, video factory and | 152 // Verify creation of PeerConnection using internal ADM, video factory and |
152 // internal libjingle threads. | 153 // internal libjingle threads. |
153 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) { | 154 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) { |
154 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( | 155 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( |
155 webrtc::CreatePeerConnectionFactory()); | 156 webrtc::CreatePeerConnectionFactory()); |
156 | 157 |
157 NullPeerConnectionObserver observer; | 158 NullPeerConnectionObserver observer; |
158 webrtc::PeerConnectionInterface::IceServers servers; | 159 webrtc::PeerConnectionInterface::IceServers servers; |
159 | 160 |
| 161 rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store( |
| 162 new FakeDtlsIdentityStore()); |
160 rtc::scoped_refptr<PeerConnectionInterface> pc( | 163 rtc::scoped_refptr<PeerConnectionInterface> pc( |
161 factory->CreatePeerConnection( | 164 factory->CreatePeerConnection( |
162 servers, NULL, NULL, new FakeIdentityService(), &observer)); | 165 servers, nullptr, nullptr, dtls_identity_store.Pass(), &observer)); |
163 | 166 |
164 EXPECT_TRUE(pc.get() != NULL); | 167 EXPECT_TRUE(pc.get() != nullptr); |
165 } | 168 } |
166 | 169 |
167 // This test verifies creation of PeerConnection with valid STUN and TURN | 170 // This test verifies creation of PeerConnection with valid STUN and TURN |
168 // configuration. Also verifies the URL's parsed correctly as expected. | 171 // configuration. Also verifies the URL's parsed correctly as expected. |
169 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { | 172 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { |
170 PeerConnectionInterface::RTCConfiguration config; | 173 PeerConnectionInterface::RTCConfiguration config; |
171 webrtc::PeerConnectionInterface::IceServer ice_server; | 174 webrtc::PeerConnectionInterface::IceServer ice_server; |
172 ice_server.uri = kStunIceServer; | 175 ice_server.uri = kStunIceServer; |
173 config.servers.push_back(ice_server); | 176 config.servers.push_back(ice_server); |
174 ice_server.uri = kTurnIceServer; | 177 ice_server.uri = kTurnIceServer; |
175 ice_server.password = kTurnPassword; | 178 ice_server.password = kTurnPassword; |
176 config.servers.push_back(ice_server); | 179 config.servers.push_back(ice_server); |
177 ice_server.uri = kTurnIceServerWithTransport; | 180 ice_server.uri = kTurnIceServerWithTransport; |
178 ice_server.password = kTurnPassword; | 181 ice_server.password = kTurnPassword; |
179 config.servers.push_back(ice_server); | 182 config.servers.push_back(ice_server); |
| 183 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 184 new FakeDtlsIdentityStore()); |
180 rtc::scoped_refptr<PeerConnectionInterface> pc( | 185 rtc::scoped_refptr<PeerConnectionInterface> pc( |
181 factory_->CreatePeerConnection(config, NULL, | 186 factory_->CreatePeerConnection(config, nullptr, |
182 allocator_factory_.get(), | 187 allocator_factory_.get(), |
183 new FakeIdentityService(), | 188 dtls_identity_store.Pass(), |
184 &observer_)); | 189 &observer_)); |
185 EXPECT_TRUE(pc.get() != NULL); | 190 EXPECT_TRUE(pc.get() != NULL); |
186 StunConfigurations stun_configs; | 191 StunConfigurations stun_configs; |
187 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( | 192 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( |
188 "stun.l.google.com", 19302); | 193 "stun.l.google.com", 19302); |
189 stun_configs.push_back(stun1); | 194 stun_configs.push_back(stun1); |
190 VerifyStunConfigurations(stun_configs); | 195 VerifyStunConfigurations(stun_configs); |
191 TurnConfigurations turn_configs; | 196 TurnConfigurations turn_configs; |
192 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( | 197 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( |
193 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); | 198 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); |
194 turn_configs.push_back(turn1); | 199 turn_configs.push_back(turn1); |
195 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( | 200 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( |
196 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); | 201 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); |
197 turn_configs.push_back(turn2); | 202 turn_configs.push_back(turn2); |
198 VerifyTurnConfigurations(turn_configs); | 203 VerifyTurnConfigurations(turn_configs); |
199 } | 204 } |
200 | 205 |
201 // This test verifies creation of PeerConnection with valid STUN and TURN | 206 // This test verifies creation of PeerConnection with valid STUN and TURN |
202 // configuration. Also verifies the list of URL's parsed correctly as expected. | 207 // configuration. Also verifies the list of URL's parsed correctly as expected. |
203 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) { | 208 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) { |
204 PeerConnectionInterface::RTCConfiguration config; | 209 PeerConnectionInterface::RTCConfiguration config; |
205 webrtc::PeerConnectionInterface::IceServer ice_server; | 210 webrtc::PeerConnectionInterface::IceServer ice_server; |
206 ice_server.urls.push_back(""); // Empty URLs should be ignored. | 211 ice_server.urls.push_back(""); // Empty URLs should be ignored. |
207 ice_server.urls.push_back(kStunIceServer); | 212 ice_server.urls.push_back(kStunIceServer); |
208 ice_server.urls.push_back(kTurnIceServer); | 213 ice_server.urls.push_back(kTurnIceServer); |
209 ice_server.urls.push_back(kTurnIceServerWithTransport); | 214 ice_server.urls.push_back(kTurnIceServerWithTransport); |
210 ice_server.password = kTurnPassword; | 215 ice_server.password = kTurnPassword; |
211 config.servers.push_back(ice_server); | 216 config.servers.push_back(ice_server); |
| 217 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 218 new FakeDtlsIdentityStore()); |
212 rtc::scoped_refptr<PeerConnectionInterface> pc( | 219 rtc::scoped_refptr<PeerConnectionInterface> pc( |
213 factory_->CreatePeerConnection(config, NULL, | 220 factory_->CreatePeerConnection(config, nullptr, |
214 allocator_factory_.get(), | 221 allocator_factory_.get(), |
215 new FakeIdentityService(), | 222 dtls_identity_store.Pass(), |
216 &observer_)); | 223 &observer_)); |
217 EXPECT_TRUE(pc.get() != NULL); | 224 EXPECT_TRUE(pc.get() != NULL); |
218 StunConfigurations stun_configs; | 225 StunConfigurations stun_configs; |
219 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( | 226 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( |
220 "stun.l.google.com", 19302); | 227 "stun.l.google.com", 19302); |
221 stun_configs.push_back(stun1); | 228 stun_configs.push_back(stun1); |
222 VerifyStunConfigurations(stun_configs); | 229 VerifyStunConfigurations(stun_configs); |
223 TurnConfigurations turn_configs; | 230 TurnConfigurations turn_configs; |
224 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( | 231 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( |
225 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); | 232 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); |
(...skipping 12 matching lines...) Expand all Loading... |
238 webrtc::PeerConnectionInterface::IceServers ice_servers; | 245 webrtc::PeerConnectionInterface::IceServers ice_servers; |
239 webrtc::PeerConnectionInterface::IceServer ice_server; | 246 webrtc::PeerConnectionInterface::IceServer ice_server; |
240 ice_server.uri = kStunIceServer; | 247 ice_server.uri = kStunIceServer; |
241 ice_servers.push_back(ice_server); | 248 ice_servers.push_back(ice_server); |
242 ice_server.uri = kTurnIceServer; | 249 ice_server.uri = kTurnIceServer; |
243 ice_server.password = kTurnPassword; | 250 ice_server.password = kTurnPassword; |
244 ice_servers.push_back(ice_server); | 251 ice_servers.push_back(ice_server); |
245 ice_server.uri = kTurnIceServerWithTransport; | 252 ice_server.uri = kTurnIceServerWithTransport; |
246 ice_server.password = kTurnPassword; | 253 ice_server.password = kTurnPassword; |
247 ice_servers.push_back(ice_server); | 254 ice_servers.push_back(ice_server); |
| 255 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 256 new FakeDtlsIdentityStore()); |
248 rtc::scoped_refptr<PeerConnectionInterface> pc( | 257 rtc::scoped_refptr<PeerConnectionInterface> pc( |
249 factory_->CreatePeerConnection(ice_servers, NULL, | 258 factory_->CreatePeerConnection(ice_servers, nullptr, |
250 allocator_factory_.get(), | 259 allocator_factory_.get(), |
251 new FakeIdentityService(), | 260 dtls_identity_store.Pass(), |
252 &observer_)); | 261 &observer_)); |
253 EXPECT_TRUE(pc.get() != NULL); | 262 EXPECT_TRUE(pc.get() != NULL); |
254 StunConfigurations stun_configs; | 263 StunConfigurations stun_configs; |
255 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( | 264 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( |
256 "stun.l.google.com", 19302); | 265 "stun.l.google.com", 19302); |
257 stun_configs.push_back(stun1); | 266 stun_configs.push_back(stun1); |
258 VerifyStunConfigurations(stun_configs); | 267 VerifyStunConfigurations(stun_configs); |
259 TurnConfigurations turn_configs; | 268 TurnConfigurations turn_configs; |
260 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( | 269 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( |
261 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); | 270 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); |
262 turn_configs.push_back(turn1); | 271 turn_configs.push_back(turn1); |
263 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( | 272 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( |
264 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); | 273 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); |
265 turn_configs.push_back(turn2); | 274 turn_configs.push_back(turn2); |
266 VerifyTurnConfigurations(turn_configs); | 275 VerifyTurnConfigurations(turn_configs); |
267 } | 276 } |
268 | 277 |
269 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { | 278 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { |
270 PeerConnectionInterface::RTCConfiguration config; | 279 PeerConnectionInterface::RTCConfiguration config; |
271 webrtc::PeerConnectionInterface::IceServer ice_server; | 280 webrtc::PeerConnectionInterface::IceServer ice_server; |
272 ice_server.uri = kStunIceServer; | 281 ice_server.uri = kStunIceServer; |
273 config.servers.push_back(ice_server); | 282 config.servers.push_back(ice_server); |
274 ice_server.uri = kTurnIceServerWithNoUsernameInUri; | 283 ice_server.uri = kTurnIceServerWithNoUsernameInUri; |
275 ice_server.username = kTurnUsername; | 284 ice_server.username = kTurnUsername; |
276 ice_server.password = kTurnPassword; | 285 ice_server.password = kTurnPassword; |
277 config.servers.push_back(ice_server); | 286 config.servers.push_back(ice_server); |
| 287 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 288 new FakeDtlsIdentityStore()); |
278 rtc::scoped_refptr<PeerConnectionInterface> pc( | 289 rtc::scoped_refptr<PeerConnectionInterface> pc( |
279 factory_->CreatePeerConnection(config, NULL, | 290 factory_->CreatePeerConnection(config, nullptr, |
280 allocator_factory_.get(), | 291 allocator_factory_.get(), |
281 new FakeIdentityService(), | 292 dtls_identity_store.Pass(), |
282 &observer_)); | 293 &observer_)); |
283 EXPECT_TRUE(pc.get() != NULL); | 294 EXPECT_TRUE(pc.get() != NULL); |
284 TurnConfigurations turn_configs; | 295 TurnConfigurations turn_configs; |
285 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( | 296 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( |
286 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false); | 297 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false); |
287 turn_configs.push_back(turn); | 298 turn_configs.push_back(turn); |
288 VerifyTurnConfigurations(turn_configs); | 299 VerifyTurnConfigurations(turn_configs); |
289 } | 300 } |
290 | 301 |
291 // This test verifies the PeerConnection created properly with TURN url which | 302 // This test verifies the PeerConnection created properly with TURN url which |
292 // has transport parameter in it. | 303 // has transport parameter in it. |
293 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { | 304 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { |
294 PeerConnectionInterface::RTCConfiguration config; | 305 PeerConnectionInterface::RTCConfiguration config; |
295 webrtc::PeerConnectionInterface::IceServer ice_server; | 306 webrtc::PeerConnectionInterface::IceServer ice_server; |
296 ice_server.uri = kTurnIceServerWithTransport; | 307 ice_server.uri = kTurnIceServerWithTransport; |
297 ice_server.password = kTurnPassword; | 308 ice_server.password = kTurnPassword; |
298 config.servers.push_back(ice_server); | 309 config.servers.push_back(ice_server); |
| 310 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 311 new FakeDtlsIdentityStore()); |
299 rtc::scoped_refptr<PeerConnectionInterface> pc( | 312 rtc::scoped_refptr<PeerConnectionInterface> pc( |
300 factory_->CreatePeerConnection(config, NULL, | 313 factory_->CreatePeerConnection(config, nullptr, |
301 allocator_factory_.get(), | 314 allocator_factory_.get(), |
302 new FakeIdentityService(), | 315 dtls_identity_store.Pass(), |
303 &observer_)); | 316 &observer_)); |
304 EXPECT_TRUE(pc.get() != NULL); | 317 EXPECT_TRUE(pc.get() != NULL); |
305 TurnConfigurations turn_configs; | 318 TurnConfigurations turn_configs; |
306 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( | 319 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( |
307 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); | 320 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); |
308 turn_configs.push_back(turn); | 321 turn_configs.push_back(turn); |
309 VerifyTurnConfigurations(turn_configs); | 322 VerifyTurnConfigurations(turn_configs); |
310 } | 323 } |
311 | 324 |
312 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { | 325 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { |
313 PeerConnectionInterface::RTCConfiguration config; | 326 PeerConnectionInterface::RTCConfiguration config; |
314 webrtc::PeerConnectionInterface::IceServer ice_server; | 327 webrtc::PeerConnectionInterface::IceServer ice_server; |
315 ice_server.uri = kSecureTurnIceServer; | 328 ice_server.uri = kSecureTurnIceServer; |
316 ice_server.password = kTurnPassword; | 329 ice_server.password = kTurnPassword; |
317 config.servers.push_back(ice_server); | 330 config.servers.push_back(ice_server); |
318 ice_server.uri = kSecureTurnIceServerWithoutTransportParam; | 331 ice_server.uri = kSecureTurnIceServerWithoutTransportParam; |
319 ice_server.password = kTurnPassword; | 332 ice_server.password = kTurnPassword; |
320 config.servers.push_back(ice_server); | 333 config.servers.push_back(ice_server); |
321 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; | 334 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; |
322 ice_server.password = kTurnPassword; | 335 ice_server.password = kTurnPassword; |
323 config.servers.push_back(ice_server); | 336 config.servers.push_back(ice_server); |
| 337 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 338 new FakeDtlsIdentityStore()); |
324 rtc::scoped_refptr<PeerConnectionInterface> pc( | 339 rtc::scoped_refptr<PeerConnectionInterface> pc( |
325 factory_->CreatePeerConnection(config, NULL, | 340 factory_->CreatePeerConnection(config, nullptr, |
326 allocator_factory_.get(), | 341 allocator_factory_.get(), |
327 new FakeIdentityService(), | 342 dtls_identity_store.Pass(), |
328 &observer_)); | 343 &observer_)); |
329 EXPECT_TRUE(pc.get() != NULL); | 344 EXPECT_TRUE(pc.get() != NULL); |
330 TurnConfigurations turn_configs; | 345 TurnConfigurations turn_configs; |
331 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( | 346 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( |
332 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true); | 347 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true); |
333 turn_configs.push_back(turn1); | 348 turn_configs.push_back(turn1); |
334 // TURNS with transport param should be default to tcp. | 349 // TURNS with transport param should be default to tcp. |
335 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( | 350 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( |
336 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true); | 351 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true); |
337 turn_configs.push_back(turn2); | 352 turn_configs.push_back(turn2); |
(...skipping 13 matching lines...) Expand all Loading... |
351 config.servers.push_back(ice_server); | 366 config.servers.push_back(ice_server); |
352 ice_server.uri = kStunIceServerWithIPv6Address; | 367 ice_server.uri = kStunIceServerWithIPv6Address; |
353 config.servers.push_back(ice_server); | 368 config.servers.push_back(ice_server); |
354 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; | 369 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; |
355 config.servers.push_back(ice_server); | 370 config.servers.push_back(ice_server); |
356 ice_server.uri = kStunIceServerWithInvalidIPv6Address; | 371 ice_server.uri = kStunIceServerWithInvalidIPv6Address; |
357 config.servers.push_back(ice_server); | 372 config.servers.push_back(ice_server); |
358 ice_server.uri = kTurnIceServerWithIPv6Address; | 373 ice_server.uri = kTurnIceServerWithIPv6Address; |
359 ice_server.password = kTurnPassword; | 374 ice_server.password = kTurnPassword; |
360 config.servers.push_back(ice_server); | 375 config.servers.push_back(ice_server); |
| 376 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
| 377 new FakeDtlsIdentityStore()); |
361 rtc::scoped_refptr<PeerConnectionInterface> pc( | 378 rtc::scoped_refptr<PeerConnectionInterface> pc( |
362 factory_->CreatePeerConnection(config, NULL, | 379 factory_->CreatePeerConnection(config, nullptr, |
363 allocator_factory_.get(), | 380 allocator_factory_.get(), |
364 new FakeIdentityService(), | 381 dtls_identity_store.Pass(), |
365 &observer_)); | 382 &observer_)); |
366 EXPECT_TRUE(pc.get() != NULL); | 383 EXPECT_TRUE(pc.get() != NULL); |
367 StunConfigurations stun_configs; | 384 StunConfigurations stun_configs; |
368 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( | 385 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( |
369 "1.2.3.4", 1234); | 386 "1.2.3.4", 1234); |
370 stun_configs.push_back(stun1); | 387 stun_configs.push_back(stun1); |
371 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2( | 388 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2( |
372 "1.2.3.4", 3478); | 389 "1.2.3.4", 3478); |
373 stun_configs.push_back(stun2); // Default port | 390 stun_configs.push_back(stun2); // Default port |
374 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3( | 391 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3( |
(...skipping 30 matching lines...) Expand all Loading... |
405 | 422 |
406 track->set_enabled(false); | 423 track->set_enabled(false); |
407 EXPECT_TRUE(capturer->CaptureFrame()); | 424 EXPECT_TRUE(capturer->CaptureFrame()); |
408 EXPECT_EQ(1, local_renderer.num_rendered_frames()); | 425 EXPECT_EQ(1, local_renderer.num_rendered_frames()); |
409 | 426 |
410 track->set_enabled(true); | 427 track->set_enabled(true); |
411 EXPECT_TRUE(capturer->CaptureFrame()); | 428 EXPECT_TRUE(capturer->CaptureFrame()); |
412 EXPECT_EQ(2, local_renderer.num_rendered_frames()); | 429 EXPECT_EQ(2, local_renderer.num_rendered_frames()); |
413 } | 430 } |
414 | 431 |
OLD | NEW |