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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 "turn:test.com:1234"; | 72 "turn:test.com:1234"; |
73 static const char kTurnPassword[] = "turnpassword"; | 73 static const char kTurnPassword[] = "turnpassword"; |
74 static const int kDefaultStunPort = 3478; | 74 static const int kDefaultStunPort = 3478; |
75 static const int kDefaultStunTlsPort = 5349; | 75 static const int kDefaultStunTlsPort = 5349; |
76 static const char kTurnUsername[] = "test"; | 76 static const char kTurnUsername[] = "test"; |
77 static const char kStunIceServerWithIPv4Address[] = "stun:1.2.3.4:1234"; | 77 static const char kStunIceServerWithIPv4Address[] = "stun:1.2.3.4:1234"; |
78 static const char kStunIceServerWithIPv4AddressWithoutPort[] = "stun:1.2.3.4"; | 78 static const char kStunIceServerWithIPv4AddressWithoutPort[] = "stun:1.2.3.4"; |
79 static const char kStunIceServerWithIPv6Address[] = "stun:[2401:fa00:4::]:1234"; | 79 static const char kStunIceServerWithIPv6Address[] = "stun:[2401:fa00:4::]:1234"; |
80 static const char kStunIceServerWithIPv6AddressWithoutPort[] = | 80 static const char kStunIceServerWithIPv6AddressWithoutPort[] = |
81 "stun:[2401:fa00:4::]"; | 81 "stun:[2401:fa00:4::]"; |
82 static const char kStunIceServerWithInvalidIPv6Address[] = | |
83 "stun:[2401:fa00:4:::3478"; | |
84 static const char kTurnIceServerWithIPv6Address[] = | 82 static const char kTurnIceServerWithIPv6Address[] = |
85 "turn:test@[2401:fa00:4::]:1234"; | 83 "turn:test@[2401:fa00:4::]:1234"; |
86 | 84 |
87 class NullPeerConnectionObserver : public PeerConnectionObserver { | 85 class NullPeerConnectionObserver : public PeerConnectionObserver { |
88 public: | 86 public: |
89 virtual void OnMessage(const std::string& msg) {} | 87 virtual void OnMessage(const std::string& msg) {} |
90 virtual void OnSignalingMessage(const std::string& msg) {} | 88 virtual void OnSignalingMessage(const std::string& msg) {} |
91 virtual void OnSignalingChange( | 89 virtual void OnSignalingChange( |
92 PeerConnectionInterface::SignalingState new_state) {} | 90 PeerConnectionInterface::SignalingState new_state) {} |
93 virtual void OnAddStream(MediaStreamInterface* stream) {} | 91 virtual void OnAddStream(MediaStreamInterface* stream) {} |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 PeerConnectionInterface::RTCConfiguration config; | 359 PeerConnectionInterface::RTCConfiguration config; |
362 webrtc::PeerConnectionInterface::IceServer ice_server; | 360 webrtc::PeerConnectionInterface::IceServer ice_server; |
363 ice_server.uri = kStunIceServerWithIPv4Address; | 361 ice_server.uri = kStunIceServerWithIPv4Address; |
364 config.servers.push_back(ice_server); | 362 config.servers.push_back(ice_server); |
365 ice_server.uri = kStunIceServerWithIPv4AddressWithoutPort; | 363 ice_server.uri = kStunIceServerWithIPv4AddressWithoutPort; |
366 config.servers.push_back(ice_server); | 364 config.servers.push_back(ice_server); |
367 ice_server.uri = kStunIceServerWithIPv6Address; | 365 ice_server.uri = kStunIceServerWithIPv6Address; |
368 config.servers.push_back(ice_server); | 366 config.servers.push_back(ice_server); |
369 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; | 367 ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort; |
370 config.servers.push_back(ice_server); | 368 config.servers.push_back(ice_server); |
371 ice_server.uri = kStunIceServerWithInvalidIPv6Address; | |
372 config.servers.push_back(ice_server); | |
373 ice_server.uri = kTurnIceServerWithIPv6Address; | 369 ice_server.uri = kTurnIceServerWithIPv6Address; |
374 ice_server.password = kTurnPassword; | 370 ice_server.password = kTurnPassword; |
375 config.servers.push_back(ice_server); | 371 config.servers.push_back(ice_server); |
376 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( | 372 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store( |
377 new FakeDtlsIdentityStore()); | 373 new FakeDtlsIdentityStore()); |
378 rtc::scoped_refptr<PeerConnectionInterface> pc( | 374 rtc::scoped_refptr<PeerConnectionInterface> pc( |
379 factory_->CreatePeerConnection(config, nullptr, | 375 factory_->CreatePeerConnection(config, nullptr, |
380 allocator_factory_.get(), | 376 allocator_factory_.get(), |
381 dtls_identity_store.Pass(), | 377 dtls_identity_store.Pass(), |
382 &observer_)); | 378 &observer_)); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 418 |
423 track->set_enabled(false); | 419 track->set_enabled(false); |
424 EXPECT_TRUE(capturer->CaptureFrame()); | 420 EXPECT_TRUE(capturer->CaptureFrame()); |
425 EXPECT_EQ(1, local_renderer.num_rendered_frames()); | 421 EXPECT_EQ(1, local_renderer.num_rendered_frames()); |
426 | 422 |
427 track->set_enabled(true); | 423 track->set_enabled(true); |
428 EXPECT_TRUE(capturer->CaptureFrame()); | 424 EXPECT_TRUE(capturer->CaptureFrame()); |
429 EXPECT_EQ(2, local_renderer.num_rendered_frames()); | 425 EXPECT_EQ(2, local_renderer.num_rendered_frames()); |
430 } | 426 } |
431 | 427 |
OLD | NEW |