Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: webrtc/pc/webrtcsession_unittest.cc

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Use AutoSocketServerThread at one more place, missed in prev patchset. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 cricket::AudioSource::Sink* sink_; 361 cricket::AudioSource::Sink* sink_;
362 }; 362 };
363 363
364 class WebRtcSessionTest 364 class WebRtcSessionTest
365 : public testing::TestWithParam<RTCCertificateGenerationMethod>, 365 : public testing::TestWithParam<RTCCertificateGenerationMethod>,
366 public sigslot::has_slots<> { 366 public sigslot::has_slots<> {
367 protected: 367 protected:
368 // TODO Investigate why ChannelManager crashes, if it's created 368 // TODO Investigate why ChannelManager crashes, if it's created
369 // after stun_server. 369 // after stun_server.
370 WebRtcSessionTest() 370 WebRtcSessionTest()
371 : media_engine_(new cricket::FakeMediaEngine()), 371 : pss_(new rtc::PhysicalSocketServer),
372 vss_(new rtc::VirtualSocketServer(pss_.get())),
373 fss_(new rtc::FirewallSocketServer(vss_.get())),
374 thread_(fss_.get()),
375 media_engine_(new cricket::FakeMediaEngine()),
372 data_engine_(new cricket::FakeDataEngine()), 376 data_engine_(new cricket::FakeDataEngine()),
373 channel_manager_(new cricket::ChannelManager( 377 channel_manager_(new cricket::ChannelManager(
374 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), 378 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_),
375 std::unique_ptr<cricket::DataEngineInterface>(data_engine_), 379 std::unique_ptr<cricket::DataEngineInterface>(data_engine_),
376 rtc::Thread::Current())), 380 rtc::Thread::Current())),
377 fake_call_(webrtc::Call::Config(&event_log_)), 381 fake_call_(webrtc::Call::Config(&event_log_)),
378 media_controller_( 382 media_controller_(
379 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), 383 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(),
380 rtc::Thread::Current(), 384 rtc::Thread::Current(),
381 channel_manager_.get(), 385 channel_manager_.get(),
382 &event_log_)), 386 &event_log_)),
383 tdesc_factory_(new cricket::TransportDescriptionFactory()), 387 tdesc_factory_(new cricket::TransportDescriptionFactory()),
384 desc_factory_( 388 desc_factory_(
385 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), 389 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(),
386 tdesc_factory_.get())), 390 tdesc_factory_.get())),
387 pss_(new rtc::PhysicalSocketServer),
388 vss_(new rtc::VirtualSocketServer(pss_.get())),
389 fss_(new rtc::FirewallSocketServer(vss_.get())),
390 ss_scope_(fss_.get()),
391 stun_socket_addr_( 391 stun_socket_addr_(
392 rtc::SocketAddress(kStunAddrHost, cricket::STUN_SERVER_PORT)), 392 rtc::SocketAddress(kStunAddrHost, cricket::STUN_SERVER_PORT)),
393 stun_server_(cricket::TestStunServer::Create(Thread::Current(), 393 stun_server_(cricket::TestStunServer::Create(Thread::Current(),
394 stun_socket_addr_)), 394 stun_socket_addr_)),
395 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), 395 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr),
396 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { 396 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) {
397 cricket::ServerAddresses stun_servers; 397 cricket::ServerAddresses stun_servers;
398 stun_servers.insert(stun_socket_addr_); 398 stun_servers.insert(stun_socket_addr_);
399 allocator_.reset(new cricket::BasicPortAllocator( 399 allocator_.reset(new cricket::BasicPortAllocator(
400 &network_manager_, 400 &network_manager_,
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); 1500 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword);
1501 turn_server.credentials = credentials; 1501 turn_server.credentials = credentials;
1502 turn_server.ports.push_back( 1502 turn_server.ports.push_back(
1503 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); 1503 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP));
1504 allocator_->AddTurnServer(turn_server); 1504 allocator_->AddTurnServer(turn_server);
1505 allocator_->set_step_delay(cricket::kMinimumStepDelay); 1505 allocator_->set_step_delay(cricket::kMinimumStepDelay);
1506 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); 1506 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP);
1507 } 1507 }
1508 1508
1509 webrtc::RtcEventLogNullImpl event_log_; 1509 webrtc::RtcEventLogNullImpl event_log_;
1510 std::unique_ptr<rtc::PhysicalSocketServer> pss_;
1511 std::unique_ptr<rtc::VirtualSocketServer> vss_;
1512 std::unique_ptr<rtc::FirewallSocketServer> fss_;
1513 rtc::AutoSocketServerThread thread_;
1510 // |media_engine_| and |data_engine_| are actually owned by 1514 // |media_engine_| and |data_engine_| are actually owned by
1511 // |channel_manager_|. 1515 // |channel_manager_|.
1512 cricket::FakeMediaEngine* media_engine_; 1516 cricket::FakeMediaEngine* media_engine_;
1513 cricket::FakeDataEngine* data_engine_; 1517 cricket::FakeDataEngine* data_engine_;
1514 // Actually owned by session_. 1518 // Actually owned by session_.
1515 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; 1519 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr;
1516 std::unique_ptr<cricket::ChannelManager> channel_manager_; 1520 std::unique_ptr<cricket::ChannelManager> channel_manager_;
1517 cricket::FakeCall fake_call_; 1521 cricket::FakeCall fake_call_;
1518 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_; 1522 std::unique_ptr<webrtc::MediaControllerInterface> media_controller_;
1519 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; 1523 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_;
1520 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; 1524 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_;
1521 std::unique_ptr<rtc::PhysicalSocketServer> pss_;
1522 std::unique_ptr<rtc::VirtualSocketServer> vss_;
1523 std::unique_ptr<rtc::FirewallSocketServer> fss_;
1524 rtc::SocketServerScope ss_scope_;
1525 rtc::SocketAddress stun_socket_addr_; 1525 rtc::SocketAddress stun_socket_addr_;
1526 std::unique_ptr<cricket::TestStunServer> stun_server_; 1526 std::unique_ptr<cricket::TestStunServer> stun_server_;
1527 cricket::TestTurnServer turn_server_; 1527 cricket::TestTurnServer turn_server_;
1528 rtc::FakeNetworkManager network_manager_; 1528 rtc::FakeNetworkManager network_manager_;
1529 std::unique_ptr<cricket::BasicPortAllocator> allocator_; 1529 std::unique_ptr<cricket::BasicPortAllocator> allocator_;
1530 PeerConnectionFactoryInterface::Options options_; 1530 PeerConnectionFactoryInterface::Options options_;
1531 PeerConnectionInterface::RTCConfiguration configuration_; 1531 PeerConnectionInterface::RTCConfiguration configuration_;
1532 std::unique_ptr<WebRtcSessionForTest> session_; 1532 std::unique_ptr<WebRtcSessionForTest> session_;
1533 MockIceObserver observer_; 1533 MockIceObserver observer_;
1534 cricket::FakeVideoMediaChannel* video_channel_; 1534 cricket::FakeVideoMediaChannel* video_channel_;
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after
4347 } 4347 }
4348 4348
4349 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4349 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4350 // currently fails because upon disconnection and reconnection OnIceComplete is 4350 // currently fails because upon disconnection and reconnection OnIceComplete is
4351 // called more than once without returning to IceGatheringGathering. 4351 // called more than once without returning to IceGatheringGathering.
4352 4352
4353 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4353 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4354 WebRtcSessionTest, 4354 WebRtcSessionTest,
4355 testing::Values(ALREADY_GENERATED, 4355 testing::Values(ALREADY_GENERATED,
4356 DTLS_IDENTITY_STORE)); 4356 DTLS_IDENTITY_STORE));
OLDNEW
« webrtc/base/thread.h ('K') | « webrtc/p2p/stunprober/stunprober_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698