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 10 matching lines...) Expand all Loading... |
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 <vector> | 28 #include <vector> |
29 | 29 |
30 #include "talk/app/webrtc/audiotrack.h" | 30 #include "talk/app/webrtc/audiotrack.h" |
| 31 #include "talk/app/webrtc/fakemediacontroller.h" |
31 #include "talk/app/webrtc/fakemetricsobserver.h" | 32 #include "talk/app/webrtc/fakemetricsobserver.h" |
32 #include "talk/app/webrtc/jsepicecandidate.h" | 33 #include "talk/app/webrtc/jsepicecandidate.h" |
33 #include "talk/app/webrtc/jsepsessiondescription.h" | 34 #include "talk/app/webrtc/jsepsessiondescription.h" |
34 #include "talk/app/webrtc/peerconnection.h" | 35 #include "talk/app/webrtc/peerconnection.h" |
35 #include "talk/app/webrtc/mediastreamsignaling.h" | 36 #include "talk/app/webrtc/mediastreamsignaling.h" |
36 #include "talk/app/webrtc/sctputils.h" | 37 #include "talk/app/webrtc/sctputils.h" |
37 #include "talk/app/webrtc/streamcollection.h" | 38 #include "talk/app/webrtc/streamcollection.h" |
38 #include "talk/app/webrtc/streamcollection.h" | 39 #include "talk/app/webrtc/streamcollection.h" |
39 #include "talk/app/webrtc/test/fakeconstraints.h" | 40 #include "talk/app/webrtc/test/fakeconstraints.h" |
40 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" | 41 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
41 #include "talk/app/webrtc/videotrack.h" | 42 #include "talk/app/webrtc/videotrack.h" |
42 #include "talk/app/webrtc/webrtcsession.h" | 43 #include "talk/app/webrtc/webrtcsession.h" |
43 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" | 44 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" |
44 #include "talk/media/base/fakemediaengine.h" | 45 #include "talk/media/base/fakemediaengine.h" |
45 #include "talk/media/base/fakevideorenderer.h" | 46 #include "talk/media/base/fakevideorenderer.h" |
46 #include "talk/media/base/mediachannel.h" | 47 #include "talk/media/base/mediachannel.h" |
| 48 #include "talk/media/webrtc/fakewebrtccall.h" |
47 #include "webrtc/p2p/base/stunserver.h" | 49 #include "webrtc/p2p/base/stunserver.h" |
48 #include "webrtc/p2p/base/teststunserver.h" | 50 #include "webrtc/p2p/base/teststunserver.h" |
49 #include "webrtc/p2p/base/testturnserver.h" | 51 #include "webrtc/p2p/base/testturnserver.h" |
50 #include "webrtc/p2p/base/transportchannel.h" | 52 #include "webrtc/p2p/base/transportchannel.h" |
51 #include "webrtc/p2p/client/basicportallocator.h" | 53 #include "webrtc/p2p/client/basicportallocator.h" |
52 #include "talk/session/media/channelmanager.h" | 54 #include "talk/session/media/channelmanager.h" |
53 #include "talk/session/media/mediasession.h" | 55 #include "talk/session/media/mediasession.h" |
54 #include "webrtc/base/fakenetwork.h" | 56 #include "webrtc/base/fakenetwork.h" |
55 #include "webrtc/base/firewallsocketserver.h" | 57 #include "webrtc/base/firewallsocketserver.h" |
56 #include "webrtc/base/gunit.h" | 58 #include "webrtc/base/gunit.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 240 |
239 bool oncandidatesready_; | 241 bool oncandidatesready_; |
240 std::vector<cricket::Candidate> mline_0_candidates_; | 242 std::vector<cricket::Candidate> mline_0_candidates_; |
241 std::vector<cricket::Candidate> mline_1_candidates_; | 243 std::vector<cricket::Candidate> mline_1_candidates_; |
242 PeerConnectionInterface::IceConnectionState ice_connection_state_; | 244 PeerConnectionInterface::IceConnectionState ice_connection_state_; |
243 PeerConnectionInterface::IceGatheringState ice_gathering_state_; | 245 PeerConnectionInterface::IceGatheringState ice_gathering_state_; |
244 }; | 246 }; |
245 | 247 |
246 class WebRtcSessionForTest : public webrtc::WebRtcSession { | 248 class WebRtcSessionForTest : public webrtc::WebRtcSession { |
247 public: | 249 public: |
248 WebRtcSessionForTest(cricket::ChannelManager* cmgr, | 250 WebRtcSessionForTest(webrtc::MediaControllerInterface* media_controller, |
249 rtc::Thread* signaling_thread, | 251 rtc::Thread* signaling_thread, |
250 rtc::Thread* worker_thread, | 252 rtc::Thread* worker_thread, |
251 cricket::PortAllocator* port_allocator, | 253 cricket::PortAllocator* port_allocator, |
252 webrtc::IceObserver* ice_observer) | 254 webrtc::IceObserver* ice_observer) |
253 : WebRtcSession(cmgr, signaling_thread, worker_thread, port_allocator) { | 255 : WebRtcSession(media_controller, |
| 256 signaling_thread, |
| 257 worker_thread, |
| 258 port_allocator) { |
254 RegisterIceObserver(ice_observer); | 259 RegisterIceObserver(ice_observer); |
255 } | 260 } |
256 virtual ~WebRtcSessionForTest() {} | 261 virtual ~WebRtcSessionForTest() {} |
257 | 262 |
258 // Note that these methods are only safe to use if the signaling thread | 263 // Note that these methods are only safe to use if the signaling thread |
259 // is the same as the worker thread | 264 // is the same as the worker thread |
260 cricket::TransportChannel* voice_rtp_transport_channel() { | 265 cricket::TransportChannel* voice_rtp_transport_channel() { |
261 return rtp_transport_channel(voice_channel()); | 266 return rtp_transport_channel(voice_channel()); |
262 } | 267 } |
263 | 268 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 cricket::AudioRenderer::Sink* sink_; | 358 cricket::AudioRenderer::Sink* sink_; |
354 }; | 359 }; |
355 | 360 |
356 class WebRtcSessionTest | 361 class WebRtcSessionTest |
357 : public testing::TestWithParam<RTCCertificateGenerationMethod>, | 362 : public testing::TestWithParam<RTCCertificateGenerationMethod>, |
358 public sigslot::has_slots<> { | 363 public sigslot::has_slots<> { |
359 protected: | 364 protected: |
360 // TODO Investigate why ChannelManager crashes, if it's created | 365 // TODO Investigate why ChannelManager crashes, if it's created |
361 // after stun_server. | 366 // after stun_server. |
362 WebRtcSessionTest() | 367 WebRtcSessionTest() |
363 : media_engine_(new cricket::FakeMediaEngine()), | 368 : media_engine_(new cricket::FakeMediaEngine()), |
364 data_engine_(new cricket::FakeDataEngine()), | 369 data_engine_(new cricket::FakeDataEngine()), |
365 channel_manager_(new cricket::ChannelManager( | 370 channel_manager_( |
366 media_engine_, data_engine_, new cricket::CaptureManager(), | 371 new cricket::ChannelManager(media_engine_, |
367 rtc::Thread::Current())), | 372 data_engine_, |
368 tdesc_factory_(new cricket::TransportDescriptionFactory()), | 373 new cricket::CaptureManager(), |
369 desc_factory_(new cricket::MediaSessionDescriptionFactory( | 374 rtc::Thread::Current())), |
370 channel_manager_.get(), tdesc_factory_.get())), | 375 fake_call_(webrtc::Call::Config()), |
371 pss_(new rtc::PhysicalSocketServer), | 376 media_controller_( |
372 vss_(new rtc::VirtualSocketServer(pss_.get())), | 377 webrtc::MediaControllerInterface::Create(rtc::Thread::Current(), |
373 fss_(new rtc::FirewallSocketServer(vss_.get())), | 378 channel_manager_.get())), |
374 ss_scope_(fss_.get()), | 379 tdesc_factory_(new cricket::TransportDescriptionFactory()), |
375 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, | 380 desc_factory_( |
376 cricket::STUN_SERVER_PORT)), | 381 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), |
377 stun_server_(cricket::TestStunServer::Create(Thread::Current(), | 382 tdesc_factory_.get())), |
378 stun_socket_addr_)), | 383 pss_(new rtc::PhysicalSocketServer), |
379 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), | 384 vss_(new rtc::VirtualSocketServer(pss_.get())), |
380 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { | 385 fss_(new rtc::FirewallSocketServer(vss_.get())), |
| 386 ss_scope_(fss_.get()), |
| 387 stun_socket_addr_( |
| 388 rtc::SocketAddress(kStunAddrHost, cricket::STUN_SERVER_PORT)), |
| 389 stun_server_(cricket::TestStunServer::Create(Thread::Current(), |
| 390 stun_socket_addr_)), |
| 391 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), |
| 392 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { |
381 cricket::ServerAddresses stun_servers; | 393 cricket::ServerAddresses stun_servers; |
382 stun_servers.insert(stun_socket_addr_); | 394 stun_servers.insert(stun_socket_addr_); |
383 allocator_.reset(new cricket::BasicPortAllocator( | 395 allocator_.reset(new cricket::BasicPortAllocator( |
384 &network_manager_, | 396 &network_manager_, |
385 stun_servers, | 397 stun_servers, |
386 SocketAddress(), SocketAddress(), SocketAddress())); | 398 SocketAddress(), SocketAddress(), SocketAddress())); |
387 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | | 399 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
388 cricket::PORTALLOCATOR_DISABLE_RELAY); | 400 cricket::PORTALLOCATOR_DISABLE_RELAY); |
389 EXPECT_TRUE(channel_manager_->Init()); | 401 EXPECT_TRUE(channel_manager_->Init()); |
390 desc_factory_->set_add_legacy_streams(false); | 402 desc_factory_->set_add_legacy_streams(false); |
391 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 403 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
392 } | 404 } |
393 | 405 |
394 void AddInterface(const SocketAddress& addr) { | 406 void AddInterface(const SocketAddress& addr) { |
395 network_manager_.AddInterface(addr); | 407 network_manager_.AddInterface(addr); |
396 } | 408 } |
397 | 409 |
398 // If |dtls_identity_store| != null or |rtc_configuration| contains | 410 // If |dtls_identity_store| != null or |rtc_configuration| contains |
399 // |certificates| then DTLS will be enabled unless explicitly disabled by | 411 // |certificates| then DTLS will be enabled unless explicitly disabled by |
400 // |rtc_configuration| options. When DTLS is enabled a certificate will be | 412 // |rtc_configuration| options. When DTLS is enabled a certificate will be |
401 // used if provided, otherwise one will be generated using the | 413 // used if provided, otherwise one will be generated using the |
402 // |dtls_identity_store|. | 414 // |dtls_identity_store|. |
403 void Init( | 415 void Init( |
404 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store, | 416 rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store, |
405 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 417 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
406 ASSERT_TRUE(session_.get() == NULL); | 418 ASSERT_TRUE(session_.get() == NULL); |
407 session_.reset(new WebRtcSessionForTest( | 419 session_.reset(new WebRtcSessionForTest( |
408 channel_manager_.get(), rtc::Thread::Current(), rtc::Thread::Current(), | 420 media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(), |
409 allocator_.get(), &observer_)); | 421 allocator_.get(), &observer_)); |
410 session_->SignalDataChannelOpenMessage.connect( | 422 session_->SignalDataChannelOpenMessage.connect( |
411 this, &WebRtcSessionTest::OnDataChannelOpenMessage); | 423 this, &WebRtcSessionTest::OnDataChannelOpenMessage); |
412 | 424 |
413 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, | 425 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, |
414 observer_.ice_connection_state_); | 426 observer_.ice_connection_state_); |
415 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, | 427 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, |
416 observer_.ice_gathering_state_); | 428 observer_.ice_gathering_state_); |
417 | 429 |
418 EXPECT_TRUE(session_->Initialize(options_, constraints_.get(), | 430 EXPECT_TRUE(session_->Initialize(options_, constraints_.get(), |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 // This code is placed in a method so that it can be invoked | 1231 // This code is placed in a method so that it can be invoked |
1220 // by multiple tests with different allocators (e.g. with and without BUNDLE). | 1232 // by multiple tests with different allocators (e.g. with and without BUNDLE). |
1221 // While running the call, this method also checks if the session goes through | 1233 // While running the call, this method also checks if the session goes through |
1222 // the correct sequence of ICE states when a connection is established, | 1234 // the correct sequence of ICE states when a connection is established, |
1223 // broken, and re-established. | 1235 // broken, and re-established. |
1224 // The Connection state should go: | 1236 // The Connection state should go: |
1225 // New -> Checking -> (Connected) -> Completed -> Disconnected -> Completed | 1237 // New -> Checking -> (Connected) -> Completed -> Disconnected -> Completed |
1226 // -> Failed. | 1238 // -> Failed. |
1227 // The Gathering state should go: New -> Gathering -> Completed. | 1239 // The Gathering state should go: New -> Gathering -> Completed. |
1228 | 1240 |
1229 void TestLoopbackCall(const LoopbackNetworkConfiguration& config) { | 1241 void SetupLoopbackCall() { |
1230 LoopbackNetworkManager loopback_network_manager(this, config); | |
1231 Init(); | 1242 Init(); |
1232 SendAudioVideoStream1(); | 1243 SendAudioVideoStream1(); |
1233 SessionDescriptionInterface* offer = CreateOffer(); | 1244 SessionDescriptionInterface* offer = CreateOffer(); |
1234 | 1245 |
1235 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, | 1246 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, |
1236 observer_.ice_gathering_state_); | 1247 observer_.ice_gathering_state_); |
1237 SetLocalDescriptionWithoutError(offer); | 1248 SetLocalDescriptionWithoutError(offer); |
1238 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, | 1249 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, |
1239 observer_.ice_connection_state_); | 1250 observer_.ice_connection_state_); |
1240 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceGatheringGathering, | 1251 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceGatheringGathering, |
1241 observer_.ice_gathering_state_, | 1252 observer_.ice_gathering_state_, kIceCandidatesTimeout); |
1242 kIceCandidatesTimeout); | |
1243 EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout); | 1253 EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout); |
1244 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceGatheringComplete, | 1254 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceGatheringComplete, |
1245 observer_.ice_gathering_state_, | 1255 observer_.ice_gathering_state_, kIceCandidatesTimeout); |
1246 kIceCandidatesTimeout); | |
1247 | 1256 |
1248 std::string sdp; | 1257 std::string sdp; |
1249 offer->ToString(&sdp); | 1258 offer->ToString(&sdp); |
1250 SessionDescriptionInterface* desc = | 1259 SessionDescriptionInterface* desc = webrtc::CreateSessionDescription( |
1251 webrtc::CreateSessionDescription( | 1260 JsepSessionDescription::kAnswer, sdp, nullptr); |
1252 JsepSessionDescription::kAnswer, sdp, nullptr); | |
1253 ASSERT_TRUE(desc != NULL); | 1261 ASSERT_TRUE(desc != NULL); |
1254 SetRemoteDescriptionWithoutError(desc); | 1262 SetRemoteDescriptionWithoutError(desc); |
1255 | 1263 |
1256 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionChecking, | 1264 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionChecking, |
1257 observer_.ice_connection_state_, | 1265 observer_.ice_connection_state_, kIceCandidatesTimeout); |
1258 kIceCandidatesTimeout); | |
1259 | 1266 |
1260 // The ice connection state is "Connected" too briefly to catch in a test. | 1267 // The ice connection state is "Connected" too briefly to catch in a test. |
1261 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionCompleted, | 1268 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionCompleted, |
1262 observer_.ice_connection_state_, | 1269 observer_.ice_connection_state_, kIceCandidatesTimeout); |
1263 kIceCandidatesTimeout); | 1270 } |
1264 | 1271 |
| 1272 void TestLoopbackCall(const LoopbackNetworkConfiguration& config) { |
| 1273 LoopbackNetworkManager loopback_network_manager(this, config); |
| 1274 SetupLoopbackCall(); |
1265 config.VerifyBestConnectionAfterIceConverge(metrics_observer_); | 1275 config.VerifyBestConnectionAfterIceConverge(metrics_observer_); |
1266 // Adding firewall rule to block ping requests, which should cause | 1276 // Adding firewall rule to block ping requests, which should cause |
1267 // transport channel failure. | 1277 // transport channel failure. |
1268 | 1278 |
1269 loopback_network_manager.ApplyFirewallRules(fss_.get()); | 1279 loopback_network_manager.ApplyFirewallRules(fss_.get()); |
1270 | 1280 |
1271 LOG(LS_INFO) << "Firewall Rules applied"; | 1281 LOG(LS_INFO) << "Firewall Rules applied"; |
1272 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, | 1282 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, |
1273 observer_.ice_connection_state_, | 1283 observer_.ice_connection_state_, |
1274 kIceCandidatesTimeout); | 1284 kIceCandidatesTimeout); |
(...skipping 18 matching lines...) Expand all Loading... |
1293 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, | 1303 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, |
1294 observer_.ice_connection_state_, | 1304 observer_.ice_connection_state_, |
1295 kIceCandidatesTimeout + port_timeout); | 1305 kIceCandidatesTimeout + port_timeout); |
1296 } | 1306 } |
1297 | 1307 |
1298 void TestLoopbackCall() { | 1308 void TestLoopbackCall() { |
1299 LoopbackNetworkConfiguration config; | 1309 LoopbackNetworkConfiguration config; |
1300 TestLoopbackCall(config); | 1310 TestLoopbackCall(config); |
1301 } | 1311 } |
1302 | 1312 |
| 1313 void TestPacketOptions() { |
| 1314 media_controller_.reset( |
| 1315 new cricket::FakeMediaController(channel_manager_.get(), &fake_call_)); |
| 1316 LoopbackNetworkConfiguration config; |
| 1317 LoopbackNetworkManager loopback_network_manager(this, config); |
| 1318 |
| 1319 SetupLoopbackCall(); |
| 1320 |
| 1321 uint8_t test_packet[15] = {0}; |
| 1322 rtc::PacketOptions options; |
| 1323 options.packet_id = 10; |
| 1324 media_engine_->GetVideoChannel(0) |
| 1325 ->SendRtp(test_packet, sizeof(test_packet), options); |
| 1326 |
| 1327 const int kPacketTimeout = 2000; |
| 1328 EXPECT_EQ_WAIT(fake_call_.last_sent_packet().packet_id, 10, kPacketTimeout); |
| 1329 EXPECT_GT(fake_call_.last_sent_packet().send_time_ms, -1); |
| 1330 } |
| 1331 |
1303 // Adds CN codecs to FakeMediaEngine and MediaDescriptionFactory. | 1332 // Adds CN codecs to FakeMediaEngine and MediaDescriptionFactory. |
1304 void AddCNCodecs() { | 1333 void AddCNCodecs() { |
1305 const cricket::AudioCodec kCNCodec1(102, "CN", 8000, 0, 1, 0); | 1334 const cricket::AudioCodec kCNCodec1(102, "CN", 8000, 0, 1, 0); |
1306 const cricket::AudioCodec kCNCodec2(103, "CN", 16000, 0, 1, 0); | 1335 const cricket::AudioCodec kCNCodec2(103, "CN", 16000, 0, 1, 0); |
1307 | 1336 |
1308 // Add kCNCodec for dtmf test. | 1337 // Add kCNCodec for dtmf test. |
1309 std::vector<cricket::AudioCodec> codecs = media_engine_->audio_codecs();; | 1338 std::vector<cricket::AudioCodec> codecs = media_engine_->audio_codecs();; |
1310 codecs.push_back(kCNCodec1); | 1339 codecs.push_back(kCNCodec1); |
1311 codecs.push_back(kCNCodec2); | 1340 codecs.push_back(kCNCodec2); |
1312 media_engine_->SetAudioCodecs(codecs); | 1341 media_engine_->SetAudioCodecs(codecs); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 relay_server.ports.push_back(cricket::ProtocolAddress( | 1428 relay_server.ports.push_back(cricket::ProtocolAddress( |
1400 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); | 1429 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); |
1401 allocator_->AddRelay(relay_server); | 1430 allocator_->AddRelay(relay_server); |
1402 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1431 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1403 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); | 1432 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1404 } | 1433 } |
1405 | 1434 |
1406 cricket::FakeMediaEngine* media_engine_; | 1435 cricket::FakeMediaEngine* media_engine_; |
1407 cricket::FakeDataEngine* data_engine_; | 1436 cricket::FakeDataEngine* data_engine_; |
1408 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 1437 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
| 1438 cricket::FakeCall fake_call_; |
| 1439 rtc::scoped_ptr<webrtc::MediaControllerInterface> media_controller_; |
1409 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; | 1440 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; |
1410 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; | 1441 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; |
1411 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; | 1442 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; |
1412 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; | 1443 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; |
1413 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; | 1444 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; |
1414 rtc::SocketServerScope ss_scope_; | 1445 rtc::SocketServerScope ss_scope_; |
1415 rtc::SocketAddress stun_socket_addr_; | 1446 rtc::SocketAddress stun_socket_addr_; |
1416 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; | 1447 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; |
1417 cricket::TestTurnServer turn_server_; | 1448 cricket::TestTurnServer turn_server_; |
1418 rtc::FakeNetworkManager network_manager_; | 1449 rtc::FakeNetworkManager network_manager_; |
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4147 | 4178 |
4148 for (auto& o : observers) { | 4179 for (auto& o : observers) { |
4149 // We expect to have received a notification now even if the session was | 4180 // We expect to have received a notification now even if the session was |
4150 // terminated. The offer creation may or may not have succeeded, but we | 4181 // terminated. The offer creation may or may not have succeeded, but we |
4151 // must have received a notification which, so the only invalid state | 4182 // must have received a notification which, so the only invalid state |
4152 // is kInit. | 4183 // is kInit. |
4153 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); | 4184 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); |
4154 } | 4185 } |
4155 } | 4186 } |
4156 | 4187 |
| 4188 TEST_F(WebRtcSessionTest, TestPacketOptionsAndOnPacketSent) { |
| 4189 TestPacketOptions(); |
| 4190 } |
| 4191 |
4157 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4192 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4158 // currently fails because upon disconnection and reconnection OnIceComplete is | 4193 // currently fails because upon disconnection and reconnection OnIceComplete is |
4159 // called more than once without returning to IceGatheringGathering. | 4194 // called more than once without returning to IceGatheringGathering. |
4160 | 4195 |
4161 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4196 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4162 WebRtcSessionTest, | 4197 WebRtcSessionTest, |
4163 testing::Values(ALREADY_GENERATED, | 4198 testing::Values(ALREADY_GENERATED, |
4164 DTLS_IDENTITY_STORE)); | 4199 DTLS_IDENTITY_STORE)); |
OLD | NEW |