OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/api/fakemetricsobserver.h" | 15 #include "webrtc/api/fakemetricsobserver.h" |
16 #include "webrtc/api/jsepicecandidate.h" | 16 #include "webrtc/api/jsepicecandidate.h" |
17 #include "webrtc/api/jsepsessiondescription.h" | 17 #include "webrtc/api/jsepsessiondescription.h" |
18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/fakenetwork.h" | 19 #include "webrtc/base/fakenetwork.h" |
20 #include "webrtc/base/firewallsocketserver.h" | 20 #include "webrtc/base/firewallsocketserver.h" |
21 #include "webrtc/base/gunit.h" | 21 #include "webrtc/base/gunit.h" |
22 #include "webrtc/base/logging.h" | 22 #include "webrtc/base/logging.h" |
23 #include "webrtc/base/network.h" | 23 #include "webrtc/base/network.h" |
24 #include "webrtc/base/physicalsocketserver.h" | |
25 #include "webrtc/base/ssladapter.h" | 24 #include "webrtc/base/ssladapter.h" |
26 #include "webrtc/base/sslidentity.h" | 25 #include "webrtc/base/sslidentity.h" |
27 #include "webrtc/base/sslstreamadapter.h" | 26 #include "webrtc/base/sslstreamadapter.h" |
28 #include "webrtc/base/stringutils.h" | 27 #include "webrtc/base/stringutils.h" |
29 #include "webrtc/base/thread.h" | 28 #include "webrtc/base/thread.h" |
30 #include "webrtc/base/virtualsocketserver.h" | 29 #include "webrtc/base/virtualsocketserver.h" |
31 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 30 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
32 #include "webrtc/media/base/fakemediaengine.h" | 31 #include "webrtc/media/base/fakemediaengine.h" |
33 #include "webrtc/media/base/fakevideorenderer.h" | 32 #include "webrtc/media/base/fakevideorenderer.h" |
34 #include "webrtc/media/base/mediachannel.h" | 33 #include "webrtc/media/base/mediachannel.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 cricket::AudioSource::Sink* sink_; | 362 cricket::AudioSource::Sink* sink_; |
364 }; | 363 }; |
365 | 364 |
366 class WebRtcSessionTest | 365 class WebRtcSessionTest |
367 : public testing::TestWithParam<RTCCertificateGenerationMethod>, | 366 : public testing::TestWithParam<RTCCertificateGenerationMethod>, |
368 public sigslot::has_slots<> { | 367 public sigslot::has_slots<> { |
369 protected: | 368 protected: |
370 // TODO Investigate why ChannelManager crashes, if it's created | 369 // TODO Investigate why ChannelManager crashes, if it's created |
371 // after stun_server. | 370 // after stun_server. |
372 WebRtcSessionTest() | 371 WebRtcSessionTest() |
373 : pss_(new rtc::PhysicalSocketServer), | 372 : vss_(new rtc::VirtualSocketServer()), |
374 vss_(new rtc::VirtualSocketServer(pss_.get())), | |
375 fss_(new rtc::FirewallSocketServer(vss_.get())), | 373 fss_(new rtc::FirewallSocketServer(vss_.get())), |
376 thread_(fss_.get()), | 374 thread_(fss_.get()), |
377 media_engine_(new cricket::FakeMediaEngine()), | 375 media_engine_(new cricket::FakeMediaEngine()), |
378 data_engine_(new cricket::FakeDataEngine()), | 376 data_engine_(new cricket::FakeDataEngine()), |
379 channel_manager_(new cricket::ChannelManager( | 377 channel_manager_(new cricket::ChannelManager( |
380 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), | 378 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
381 std::unique_ptr<cricket::DataEngineInterface>(data_engine_), | 379 std::unique_ptr<cricket::DataEngineInterface>(data_engine_), |
382 rtc::Thread::Current())), | 380 rtc::Thread::Current())), |
383 fake_call_(webrtc::Call::Config(&event_log_)), | 381 fake_call_(webrtc::Call::Config(&event_log_)), |
384 tdesc_factory_(new cricket::TransportDescriptionFactory()), | 382 tdesc_factory_(new cricket::TransportDescriptionFactory()), |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); | 1494 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); |
1497 turn_server.credentials = credentials; | 1495 turn_server.credentials = credentials; |
1498 turn_server.ports.push_back( | 1496 turn_server.ports.push_back( |
1499 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); | 1497 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); |
1500 allocator_->AddTurnServer(turn_server); | 1498 allocator_->AddTurnServer(turn_server); |
1501 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1499 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1502 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); | 1500 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1503 } | 1501 } |
1504 | 1502 |
1505 webrtc::RtcEventLogNullImpl event_log_; | 1503 webrtc::RtcEventLogNullImpl event_log_; |
1506 std::unique_ptr<rtc::PhysicalSocketServer> pss_; | |
1507 std::unique_ptr<rtc::VirtualSocketServer> vss_; | 1504 std::unique_ptr<rtc::VirtualSocketServer> vss_; |
1508 std::unique_ptr<rtc::FirewallSocketServer> fss_; | 1505 std::unique_ptr<rtc::FirewallSocketServer> fss_; |
1509 rtc::AutoSocketServerThread thread_; | 1506 rtc::AutoSocketServerThread thread_; |
1510 // |media_engine_| and |data_engine_| are actually owned by | 1507 // |media_engine_| and |data_engine_| are actually owned by |
1511 // |channel_manager_|. | 1508 // |channel_manager_|. |
1512 cricket::FakeMediaEngine* media_engine_; | 1509 cricket::FakeMediaEngine* media_engine_; |
1513 cricket::FakeDataEngine* data_engine_; | 1510 cricket::FakeDataEngine* data_engine_; |
1514 // Actually owned by session_. | 1511 // Actually owned by session_. |
1515 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; | 1512 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; |
1516 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 1513 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
(...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4342 } | 4339 } |
4343 | 4340 |
4344 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4341 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4345 // currently fails because upon disconnection and reconnection OnIceComplete is | 4342 // currently fails because upon disconnection and reconnection OnIceComplete is |
4346 // called more than once without returning to IceGatheringGathering. | 4343 // called more than once without returning to IceGatheringGathering. |
4347 | 4344 |
4348 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4345 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4349 WebRtcSessionTest, | 4346 WebRtcSessionTest, |
4350 testing::Values(ALREADY_GENERATED, | 4347 testing::Values(ALREADY_GENERATED, |
4351 DTLS_IDENTITY_STORE)); | 4348 DTLS_IDENTITY_STORE)); |
OLD | NEW |