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 24 matching lines...) Expand all Loading... |
35 #include "talk/app/webrtc/streamcollection.h" | 35 #include "talk/app/webrtc/streamcollection.h" |
36 #include "talk/app/webrtc/test/fakeconstraints.h" | 36 #include "talk/app/webrtc/test/fakeconstraints.h" |
37 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" | 37 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
38 #include "talk/app/webrtc/test/fakemediastreamsignaling.h" | 38 #include "talk/app/webrtc/test/fakemediastreamsignaling.h" |
39 #include "talk/app/webrtc/videotrack.h" | 39 #include "talk/app/webrtc/videotrack.h" |
40 #include "talk/app/webrtc/webrtcsession.h" | 40 #include "talk/app/webrtc/webrtcsession.h" |
41 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" | 41 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" |
42 #include "talk/media/base/fakemediaengine.h" | 42 #include "talk/media/base/fakemediaengine.h" |
43 #include "talk/media/base/fakevideorenderer.h" | 43 #include "talk/media/base/fakevideorenderer.h" |
44 #include "talk/media/base/mediachannel.h" | 44 #include "talk/media/base/mediachannel.h" |
45 #include "talk/media/devices/fakedevicemanager.h" | |
46 #include "webrtc/p2p/base/stunserver.h" | 45 #include "webrtc/p2p/base/stunserver.h" |
47 #include "webrtc/p2p/base/teststunserver.h" | 46 #include "webrtc/p2p/base/teststunserver.h" |
48 #include "webrtc/p2p/base/testturnserver.h" | 47 #include "webrtc/p2p/base/testturnserver.h" |
49 #include "webrtc/p2p/base/transportchannel.h" | 48 #include "webrtc/p2p/base/transportchannel.h" |
50 #include "webrtc/p2p/client/basicportallocator.h" | 49 #include "webrtc/p2p/client/basicportallocator.h" |
51 #include "talk/session/media/channelmanager.h" | 50 #include "talk/session/media/channelmanager.h" |
52 #include "talk/session/media/mediasession.h" | 51 #include "talk/session/media/mediasession.h" |
53 #include "webrtc/base/fakenetwork.h" | 52 #include "webrtc/base/fakenetwork.h" |
54 #include "webrtc/base/firewallsocketserver.h" | 53 #include "webrtc/base/firewallsocketserver.h" |
55 #include "webrtc/base/gunit.h" | 54 #include "webrtc/base/gunit.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 }; | 354 }; |
356 | 355 |
357 class WebRtcSessionTest | 356 class WebRtcSessionTest |
358 : public testing::TestWithParam<RTCCertificateGenerationMethod> { | 357 : public testing::TestWithParam<RTCCertificateGenerationMethod> { |
359 protected: | 358 protected: |
360 // TODO Investigate why ChannelManager crashes, if it's created | 359 // TODO Investigate why ChannelManager crashes, if it's created |
361 // after stun_server. | 360 // after stun_server. |
362 WebRtcSessionTest() | 361 WebRtcSessionTest() |
363 : media_engine_(new cricket::FakeMediaEngine()), | 362 : media_engine_(new cricket::FakeMediaEngine()), |
364 data_engine_(new cricket::FakeDataEngine()), | 363 data_engine_(new cricket::FakeDataEngine()), |
365 device_manager_(new cricket::FakeDeviceManager()), | |
366 channel_manager_(new cricket::ChannelManager( | 364 channel_manager_(new cricket::ChannelManager( |
367 media_engine_, data_engine_, device_manager_, | 365 media_engine_, data_engine_, new cricket::CaptureManager(), |
368 new cricket::CaptureManager(), rtc::Thread::Current())), | 366 rtc::Thread::Current())), |
369 tdesc_factory_(new cricket::TransportDescriptionFactory()), | 367 tdesc_factory_(new cricket::TransportDescriptionFactory()), |
370 desc_factory_(new cricket::MediaSessionDescriptionFactory( | 368 desc_factory_(new cricket::MediaSessionDescriptionFactory( |
371 channel_manager_.get(), tdesc_factory_.get())), | 369 channel_manager_.get(), tdesc_factory_.get())), |
372 pss_(new rtc::PhysicalSocketServer), | 370 pss_(new rtc::PhysicalSocketServer), |
373 vss_(new rtc::VirtualSocketServer(pss_.get())), | 371 vss_(new rtc::VirtualSocketServer(pss_.get())), |
374 fss_(new rtc::FirewallSocketServer(vss_.get())), | 372 fss_(new rtc::FirewallSocketServer(vss_.get())), |
375 ss_scope_(fss_.get()), | 373 ss_scope_(fss_.get()), |
376 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, | 374 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, |
377 cricket::STUN_SERVER_PORT)), | 375 cricket::STUN_SERVER_PORT)), |
378 stun_server_(cricket::TestStunServer::Create(Thread::Current(), | 376 stun_server_(cricket::TestStunServer::Create(Thread::Current(), |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 relay_server.credentials = credentials; | 1294 relay_server.credentials = credentials; |
1297 relay_server.ports.push_back(cricket::ProtocolAddress( | 1295 relay_server.ports.push_back(cricket::ProtocolAddress( |
1298 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); | 1296 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); |
1299 allocator_->AddRelay(relay_server); | 1297 allocator_->AddRelay(relay_server); |
1300 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1298 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1301 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); | 1299 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1302 } | 1300 } |
1303 | 1301 |
1304 cricket::FakeMediaEngine* media_engine_; | 1302 cricket::FakeMediaEngine* media_engine_; |
1305 cricket::FakeDataEngine* data_engine_; | 1303 cricket::FakeDataEngine* data_engine_; |
1306 cricket::FakeDeviceManager* device_manager_; | |
1307 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 1304 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
1308 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; | 1305 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; |
1309 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; | 1306 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; |
1310 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; | 1307 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; |
1311 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; | 1308 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; |
1312 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; | 1309 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; |
1313 rtc::SocketServerScope ss_scope_; | 1310 rtc::SocketServerScope ss_scope_; |
1314 rtc::SocketAddress stun_socket_addr_; | 1311 rtc::SocketAddress stun_socket_addr_; |
1315 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; | 1312 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; |
1316 cricket::TestTurnServer turn_server_; | 1313 cricket::TestTurnServer turn_server_; |
(...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4036 } | 4033 } |
4037 | 4034 |
4038 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4035 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4039 // currently fails because upon disconnection and reconnection OnIceComplete is | 4036 // currently fails because upon disconnection and reconnection OnIceComplete is |
4040 // called more than once without returning to IceGatheringGathering. | 4037 // called more than once without returning to IceGatheringGathering. |
4041 | 4038 |
4042 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4039 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4043 WebRtcSessionTest, | 4040 WebRtcSessionTest, |
4044 testing::Values(ALREADY_GENERATED, | 4041 testing::Values(ALREADY_GENERATED, |
4045 DTLS_IDENTITY_STORE)); | 4042 DTLS_IDENTITY_STORE)); |
OLD | NEW |