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

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

Issue 1151943005: Ability to specify KeyType (RSA, ECDSA) for SSLIdentity generation in libjingle (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing ASAN, LSAN issues in unittests Created 5 years, 6 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 * 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
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 EXPECT_EQ(turn_config[i].server.ToString(), 138 EXPECT_EQ(turn_config[i].server.ToString(),
138 allocator->turn_configs()[i].server.ToString()); 139 allocator->turn_configs()[i].server.ToString());
139 EXPECT_EQ(turn_config[i].username, allocator->turn_configs()[i].username); 140 EXPECT_EQ(turn_config[i].username, allocator->turn_configs()[i].username);
140 EXPECT_EQ(turn_config[i].password, allocator->turn_configs()[i].password); 141 EXPECT_EQ(turn_config[i].password, allocator->turn_configs()[i].password);
141 EXPECT_EQ(turn_config[i].transport_type, 142 EXPECT_EQ(turn_config[i].transport_type,
142 allocator->turn_configs()[i].transport_type); 143 allocator->turn_configs()[i].transport_type);
143 } 144 }
144 } 145 }
145 146
146 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_; 147 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
148 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_;
147 NullPeerConnectionObserver observer_; 149 NullPeerConnectionObserver observer_;
148 rtc::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_; 150 rtc::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_;
149 }; 151 };
150 152
151 // Verify creation of PeerConnection using internal ADM, video factory and 153 // Verify creation of PeerConnection using internal ADM, video factory and
152 // internal libjingle threads. 154 // internal libjingle threads.
153 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) { 155 TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) {
154 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( 156 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
155 webrtc::CreatePeerConnectionFactory()); 157 webrtc::CreatePeerConnectionFactory());
156 158
157 NullPeerConnectionObserver observer; 159 NullPeerConnectionObserver observer;
158 webrtc::PeerConnectionInterface::IceServers servers; 160 webrtc::PeerConnectionInterface::IceServers servers;
159 161
162 rtc::scoped_ptr<FakeDtlsIdentityStoreRSA> dtls_identity_store(
163 new FakeDtlsIdentityStoreRSA());
160 rtc::scoped_refptr<PeerConnectionInterface> pc( 164 rtc::scoped_refptr<PeerConnectionInterface> pc(
161 factory->CreatePeerConnection( 165 factory->CreatePeerConnection(
162 servers, NULL, NULL, new FakeIdentityService(), &observer)); 166 servers, NULL, NULL, &observer, dtls_identity_store.get()));
163 167
164 EXPECT_TRUE(pc.get() != NULL); 168 EXPECT_TRUE(pc.get() != NULL);
165 } 169 }
166 170
167 // This test verifies creation of PeerConnection with valid STUN and TURN 171 // This test verifies creation of PeerConnection with valid STUN and TURN
168 // configuration. Also verifies the URL's parsed correctly as expected. 172 // configuration. Also verifies the URL's parsed correctly as expected.
169 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) { 173 TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
170 PeerConnectionInterface::RTCConfiguration config; 174 PeerConnectionInterface::RTCConfiguration config;
171 webrtc::PeerConnectionInterface::IceServer ice_server; 175 webrtc::PeerConnectionInterface::IceServer ice_server;
172 ice_server.uri = kStunIceServer; 176 ice_server.uri = kStunIceServer;
173 config.servers.push_back(ice_server); 177 config.servers.push_back(ice_server);
174 ice_server.uri = kTurnIceServer; 178 ice_server.uri = kTurnIceServer;
175 ice_server.password = kTurnPassword; 179 ice_server.password = kTurnPassword;
176 config.servers.push_back(ice_server); 180 config.servers.push_back(ice_server);
177 ice_server.uri = kTurnIceServerWithTransport; 181 ice_server.uri = kTurnIceServerWithTransport;
178 ice_server.password = kTurnPassword; 182 ice_server.password = kTurnPassword;
179 config.servers.push_back(ice_server); 183 config.servers.push_back(ice_server);
184 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
180 rtc::scoped_refptr<PeerConnectionInterface> pc( 185 rtc::scoped_refptr<PeerConnectionInterface> pc(
181 factory_->CreatePeerConnection(config, NULL, 186 factory_->CreatePeerConnection(config, NULL,
182 allocator_factory_.get(), 187 allocator_factory_.get(),
183 new FakeIdentityService(), 188 &observer_,
184 &observer_)); 189 dtls_identity_store_.get()));
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 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
212 rtc::scoped_refptr<PeerConnectionInterface> pc( 218 rtc::scoped_refptr<PeerConnectionInterface> pc(
213 factory_->CreatePeerConnection(config, NULL, 219 factory_->CreatePeerConnection(config, NULL,
214 allocator_factory_.get(), 220 allocator_factory_.get(),
215 new FakeIdentityService(), 221 &observer_,
216 &observer_)); 222 dtls_identity_store_.get()));
217 EXPECT_TRUE(pc.get() != NULL); 223 EXPECT_TRUE(pc.get() != NULL);
218 StunConfigurations stun_configs; 224 StunConfigurations stun_configs;
219 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 225 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
220 "stun.l.google.com", 19302); 226 "stun.l.google.com", 19302);
221 stun_configs.push_back(stun1); 227 stun_configs.push_back(stun1);
222 VerifyStunConfigurations(stun_configs); 228 VerifyStunConfigurations(stun_configs);
223 TurnConfigurations turn_configs; 229 TurnConfigurations turn_configs;
224 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 230 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
225 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); 231 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false);
226 turn_configs.push_back(turn1); 232 turn_configs.push_back(turn1);
(...skipping 11 matching lines...) Expand all
238 webrtc::PeerConnectionInterface::IceServers ice_servers; 244 webrtc::PeerConnectionInterface::IceServers ice_servers;
239 webrtc::PeerConnectionInterface::IceServer ice_server; 245 webrtc::PeerConnectionInterface::IceServer ice_server;
240 ice_server.uri = kStunIceServer; 246 ice_server.uri = kStunIceServer;
241 ice_servers.push_back(ice_server); 247 ice_servers.push_back(ice_server);
242 ice_server.uri = kTurnIceServer; 248 ice_server.uri = kTurnIceServer;
243 ice_server.password = kTurnPassword; 249 ice_server.password = kTurnPassword;
244 ice_servers.push_back(ice_server); 250 ice_servers.push_back(ice_server);
245 ice_server.uri = kTurnIceServerWithTransport; 251 ice_server.uri = kTurnIceServerWithTransport;
246 ice_server.password = kTurnPassword; 252 ice_server.password = kTurnPassword;
247 ice_servers.push_back(ice_server); 253 ice_servers.push_back(ice_server);
254 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
248 rtc::scoped_refptr<PeerConnectionInterface> pc( 255 rtc::scoped_refptr<PeerConnectionInterface> pc(
249 factory_->CreatePeerConnection(ice_servers, NULL, 256 factory_->CreatePeerConnection(ice_servers, NULL,
250 allocator_factory_.get(), 257 allocator_factory_.get(),
251 new FakeIdentityService(), 258 &observer_,
252 &observer_)); 259 dtls_identity_store_.get()));
253 EXPECT_TRUE(pc.get() != NULL); 260 EXPECT_TRUE(pc.get() != NULL);
254 StunConfigurations stun_configs; 261 StunConfigurations stun_configs;
255 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 262 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
256 "stun.l.google.com", 19302); 263 "stun.l.google.com", 19302);
257 stun_configs.push_back(stun1); 264 stun_configs.push_back(stun1);
258 VerifyStunConfigurations(stun_configs); 265 VerifyStunConfigurations(stun_configs);
259 TurnConfigurations turn_configs; 266 TurnConfigurations turn_configs;
260 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 267 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
261 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false); 268 "test.com", 1234, "test@hello.com", kTurnPassword, "udp", false);
262 turn_configs.push_back(turn1); 269 turn_configs.push_back(turn1);
263 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( 270 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2(
264 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); 271 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false);
265 turn_configs.push_back(turn2); 272 turn_configs.push_back(turn2);
266 VerifyTurnConfigurations(turn_configs); 273 VerifyTurnConfigurations(turn_configs);
267 } 274 }
268 275
269 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) { 276 TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) {
270 PeerConnectionInterface::RTCConfiguration config; 277 PeerConnectionInterface::RTCConfiguration config;
271 webrtc::PeerConnectionInterface::IceServer ice_server; 278 webrtc::PeerConnectionInterface::IceServer ice_server;
272 ice_server.uri = kStunIceServer; 279 ice_server.uri = kStunIceServer;
273 config.servers.push_back(ice_server); 280 config.servers.push_back(ice_server);
274 ice_server.uri = kTurnIceServerWithNoUsernameInUri; 281 ice_server.uri = kTurnIceServerWithNoUsernameInUri;
275 ice_server.username = kTurnUsername; 282 ice_server.username = kTurnUsername;
276 ice_server.password = kTurnPassword; 283 ice_server.password = kTurnPassword;
277 config.servers.push_back(ice_server); 284 config.servers.push_back(ice_server);
285 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
278 rtc::scoped_refptr<PeerConnectionInterface> pc( 286 rtc::scoped_refptr<PeerConnectionInterface> pc(
279 factory_->CreatePeerConnection(config, NULL, 287 factory_->CreatePeerConnection(config, NULL,
280 allocator_factory_.get(), 288 allocator_factory_.get(),
281 new FakeIdentityService(), 289 &observer_,
282 &observer_)); 290 dtls_identity_store_.get()));
283 EXPECT_TRUE(pc.get() != NULL); 291 EXPECT_TRUE(pc.get() != NULL);
284 TurnConfigurations turn_configs; 292 TurnConfigurations turn_configs;
285 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( 293 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
286 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false); 294 "test.com", 1234, kTurnUsername, kTurnPassword, "udp", false);
287 turn_configs.push_back(turn); 295 turn_configs.push_back(turn);
288 VerifyTurnConfigurations(turn_configs); 296 VerifyTurnConfigurations(turn_configs);
289 } 297 }
290 298
291 // This test verifies the PeerConnection created properly with TURN url which 299 // This test verifies the PeerConnection created properly with TURN url which
292 // has transport parameter in it. 300 // has transport parameter in it.
293 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) { 301 TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) {
294 PeerConnectionInterface::RTCConfiguration config; 302 PeerConnectionInterface::RTCConfiguration config;
295 webrtc::PeerConnectionInterface::IceServer ice_server; 303 webrtc::PeerConnectionInterface::IceServer ice_server;
296 ice_server.uri = kTurnIceServerWithTransport; 304 ice_server.uri = kTurnIceServerWithTransport;
297 ice_server.password = kTurnPassword; 305 ice_server.password = kTurnPassword;
298 config.servers.push_back(ice_server); 306 config.servers.push_back(ice_server);
307 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
299 rtc::scoped_refptr<PeerConnectionInterface> pc( 308 rtc::scoped_refptr<PeerConnectionInterface> pc(
300 factory_->CreatePeerConnection(config, NULL, 309 factory_->CreatePeerConnection(config, NULL,
301 allocator_factory_.get(), 310 allocator_factory_.get(),
302 new FakeIdentityService(), 311 &observer_,
303 &observer_)); 312 dtls_identity_store_.get()));
304 EXPECT_TRUE(pc.get() != NULL); 313 EXPECT_TRUE(pc.get() != NULL);
305 TurnConfigurations turn_configs; 314 TurnConfigurations turn_configs;
306 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn( 315 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn(
307 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false); 316 "hello.com", kDefaultStunPort, "test", kTurnPassword, "tcp", false);
308 turn_configs.push_back(turn); 317 turn_configs.push_back(turn);
309 VerifyTurnConfigurations(turn_configs); 318 VerifyTurnConfigurations(turn_configs);
310 } 319 }
311 320
312 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) { 321 TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) {
313 PeerConnectionInterface::RTCConfiguration config; 322 PeerConnectionInterface::RTCConfiguration config;
314 webrtc::PeerConnectionInterface::IceServer ice_server; 323 webrtc::PeerConnectionInterface::IceServer ice_server;
315 ice_server.uri = kSecureTurnIceServer; 324 ice_server.uri = kSecureTurnIceServer;
316 ice_server.password = kTurnPassword; 325 ice_server.password = kTurnPassword;
317 config.servers.push_back(ice_server); 326 config.servers.push_back(ice_server);
318 ice_server.uri = kSecureTurnIceServerWithoutTransportParam; 327 ice_server.uri = kSecureTurnIceServerWithoutTransportParam;
319 ice_server.password = kTurnPassword; 328 ice_server.password = kTurnPassword;
320 config.servers.push_back(ice_server); 329 config.servers.push_back(ice_server);
321 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam; 330 ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam;
322 ice_server.password = kTurnPassword; 331 ice_server.password = kTurnPassword;
323 config.servers.push_back(ice_server); 332 config.servers.push_back(ice_server);
333 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
324 rtc::scoped_refptr<PeerConnectionInterface> pc( 334 rtc::scoped_refptr<PeerConnectionInterface> pc(
325 factory_->CreatePeerConnection(config, NULL, 335 factory_->CreatePeerConnection(config, NULL,
326 allocator_factory_.get(), 336 allocator_factory_.get(),
327 new FakeIdentityService(), 337 &observer_,
328 &observer_)); 338 dtls_identity_store_.get()));
329 EXPECT_TRUE(pc.get() != NULL); 339 EXPECT_TRUE(pc.get() != NULL);
330 TurnConfigurations turn_configs; 340 TurnConfigurations turn_configs;
331 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1( 341 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn1(
332 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true); 342 "hello.com", kDefaultStunTlsPort, "test", kTurnPassword, "tcp", true);
333 turn_configs.push_back(turn1); 343 turn_configs.push_back(turn1);
334 // TURNS with transport param should be default to tcp. 344 // TURNS with transport param should be default to tcp.
335 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2( 345 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn2(
336 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true); 346 "hello.com", 443, "test_no_transport", kTurnPassword, "tcp", true);
337 turn_configs.push_back(turn2); 347 turn_configs.push_back(turn2);
338 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn3( 348 webrtc::PortAllocatorFactoryInterface::TurnConfiguration turn3(
(...skipping 12 matching lines...) Expand all
351 config.servers.push_back(ice_server); 361 config.servers.push_back(ice_server);
352 ice_server.uri = kStunIceServerWithIPv6Address; 362 ice_server.uri = kStunIceServerWithIPv6Address;
353 config.servers.push_back(ice_server); 363 config.servers.push_back(ice_server);
354 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; 364 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort;
355 config.servers.push_back(ice_server); 365 config.servers.push_back(ice_server);
356 ice_server.uri = kStunIceServerWithInvalidIPv6Address; 366 ice_server.uri = kStunIceServerWithInvalidIPv6Address;
357 config.servers.push_back(ice_server); 367 config.servers.push_back(ice_server);
358 ice_server.uri = kTurnIceServerWithIPv6Address; 368 ice_server.uri = kTurnIceServerWithIPv6Address;
359 ice_server.password = kTurnPassword; 369 ice_server.password = kTurnPassword;
360 config.servers.push_back(ice_server); 370 config.servers.push_back(ice_server);
371 dtls_identity_store_.reset(new FakeDtlsIdentityStoreRSA());
361 rtc::scoped_refptr<PeerConnectionInterface> pc( 372 rtc::scoped_refptr<PeerConnectionInterface> pc(
362 factory_->CreatePeerConnection(config, NULL, 373 factory_->CreatePeerConnection(config, NULL,
363 allocator_factory_.get(), 374 allocator_factory_.get(),
364 new FakeIdentityService(), 375 &observer_,
365 &observer_)); 376 dtls_identity_store_.get()));
366 EXPECT_TRUE(pc.get() != NULL); 377 EXPECT_TRUE(pc.get() != NULL);
367 StunConfigurations stun_configs; 378 StunConfigurations stun_configs;
368 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1( 379 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun1(
369 "1.2.3.4", 1234); 380 "1.2.3.4", 1234);
370 stun_configs.push_back(stun1); 381 stun_configs.push_back(stun1);
371 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2( 382 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun2(
372 "1.2.3.4", 3478); 383 "1.2.3.4", 3478);
373 stun_configs.push_back(stun2); // Default port 384 stun_configs.push_back(stun2); // Default port
374 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3( 385 webrtc::PortAllocatorFactoryInterface::StunConfiguration stun3(
375 "2401:fa00:4::", 1234); 386 "2401:fa00:4::", 1234);
(...skipping 29 matching lines...) Expand all
405 416
406 track->set_enabled(false); 417 track->set_enabled(false);
407 EXPECT_TRUE(capturer->CaptureFrame()); 418 EXPECT_TRUE(capturer->CaptureFrame());
408 EXPECT_EQ(1, local_renderer.num_rendered_frames()); 419 EXPECT_EQ(1, local_renderer.num_rendered_frames());
409 420
410 track->set_enabled(true); 421 track->set_enabled(true);
411 EXPECT_TRUE(capturer->CaptureFrame()); 422 EXPECT_TRUE(capturer->CaptureFrame());
412 EXPECT_EQ(2, local_renderer.num_rendered_frames()); 423 EXPECT_EQ(2, local_renderer.num_rendered_frames());
413 } 424 }
414 425
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698