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 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 class WebRtcSessionTest | 363 class WebRtcSessionTest |
364 : public testing::TestWithParam<RTCCertificateGenerationMethod>, | 364 : public testing::TestWithParam<RTCCertificateGenerationMethod>, |
365 public sigslot::has_slots<> { | 365 public sigslot::has_slots<> { |
366 protected: | 366 protected: |
367 // TODO Investigate why ChannelManager crashes, if it's created | 367 // TODO Investigate why ChannelManager crashes, if it's created |
368 // after stun_server. | 368 // after stun_server. |
369 WebRtcSessionTest() | 369 WebRtcSessionTest() |
370 : media_engine_(new cricket::FakeMediaEngine()), | 370 : media_engine_(new cricket::FakeMediaEngine()), |
371 data_engine_(new cricket::FakeDataEngine()), | 371 data_engine_(new cricket::FakeDataEngine()), |
372 channel_manager_(new cricket::ChannelManager(media_engine_, | 372 channel_manager_(new cricket::ChannelManager( |
373 data_engine_, | 373 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
374 rtc::Thread::Current())), | 374 std::unique_ptr<cricket::DataEngineInterface>(data_engine_), |
| 375 rtc::Thread::Current())), |
375 fake_call_(webrtc::Call::Config(&event_log_)), | 376 fake_call_(webrtc::Call::Config(&event_log_)), |
376 media_controller_( | 377 media_controller_( |
377 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), | 378 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), |
378 rtc::Thread::Current(), | 379 rtc::Thread::Current(), |
379 channel_manager_.get(), | 380 channel_manager_.get(), |
380 &event_log_)), | 381 &event_log_)), |
381 tdesc_factory_(new cricket::TransportDescriptionFactory()), | 382 tdesc_factory_(new cricket::TransportDescriptionFactory()), |
382 desc_factory_( | 383 desc_factory_( |
383 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), | 384 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), |
384 tdesc_factory_.get())), | 385 tdesc_factory_.get())), |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); | 1498 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); |
1498 turn_server.credentials = credentials; | 1499 turn_server.credentials = credentials; |
1499 turn_server.ports.push_back( | 1500 turn_server.ports.push_back( |
1500 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); | 1501 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); |
1501 allocator_->AddTurnServer(turn_server); | 1502 allocator_->AddTurnServer(turn_server); |
1502 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1503 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1503 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); | 1504 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1504 } | 1505 } |
1505 | 1506 |
1506 webrtc::RtcEventLogNullImpl event_log_; | 1507 webrtc::RtcEventLogNullImpl event_log_; |
| 1508 // |media_engine_| and |data_engine_| are actually owned by |
| 1509 // |channel_manager_|. |
1507 cricket::FakeMediaEngine* media_engine_; | 1510 cricket::FakeMediaEngine* media_engine_; |
1508 cricket::FakeDataEngine* data_engine_; | 1511 cricket::FakeDataEngine* data_engine_; |
1509 // Actually owned by session_. | 1512 // Actually owned by session_. |
1510 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; | 1513 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; |
1511 std::unique_ptr<cricket::ChannelManager> channel_manager_; | 1514 std::unique_ptr<cricket::ChannelManager> channel_manager_; |
1512 cricket::FakeCall fake_call_; | 1515 cricket::FakeCall fake_call_; |
1513 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; | 1516 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; |
1514 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; | 1517 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; |
1515 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; | 1518 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; |
1516 std::unique_ptr<rtc::PhysicalSocketServer> pss_; | 1519 std::unique_ptr<rtc::PhysicalSocketServer> pss_; |
(...skipping 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4339 } | 4342 } |
4340 | 4343 |
4341 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4344 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4342 // currently fails because upon disconnection and reconnection OnIceComplete is | 4345 // currently fails because upon disconnection and reconnection OnIceComplete is |
4343 // called more than once without returning to IceGatheringGathering. | 4346 // called more than once without returning to IceGatheringGathering. |
4344 | 4347 |
4345 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4348 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4346 WebRtcSessionTest, | 4349 WebRtcSessionTest, |
4347 testing::Values(ALREADY_GENERATED, | 4350 testing::Values(ALREADY_GENERATED, |
4348 DTLS_IDENTITY_STORE)); | 4351 DTLS_IDENTITY_STORE)); |
OLD | NEW |