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

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

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « webrtc/p2p/stunprober/stunprober_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 cricket::AudioSource::Sink* sink_; 363 cricket::AudioSource::Sink* sink_;
364 }; 364 };
365 365
366 class WebRtcSessionTest 366 class WebRtcSessionTest
367 : public testing::TestWithParam<RTCCertificateGenerationMethod>, 367 : public testing::TestWithParam<RTCCertificateGenerationMethod>,
368 public sigslot::has_slots<> { 368 public sigslot::has_slots<> {
369 protected: 369 protected:
370 // TODO Investigate why ChannelManager crashes, if it's created 370 // TODO Investigate why ChannelManager crashes, if it's created
371 // after stun_server. 371 // after stun_server.
372 WebRtcSessionTest() 372 WebRtcSessionTest()
373 : media_engine_(new cricket::FakeMediaEngine()), 373 : pss_(new rtc::PhysicalSocketServer),
374 vss_(new rtc::VirtualSocketServer(pss_.get())),
375 fss_(new rtc::FirewallSocketServer(vss_.get())),
376 thread_(fss_.get()),
377 media_engine_(new cricket::FakeMediaEngine()),
374 data_engine_(new cricket::FakeDataEngine()), 378 data_engine_(new cricket::FakeDataEngine()),
375 channel_manager_(new cricket::ChannelManager( 379 channel_manager_(new cricket::ChannelManager(
376 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), 380 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_),
377 std::unique_ptr<cricket::DataEngineInterface>(data_engine_), 381 std::unique_ptr<cricket::DataEngineInterface>(data_engine_),
378 rtc::Thread::Current())), 382 rtc::Thread::Current())),
379 fake_call_(webrtc::Call::Config(&event_log_)), 383 fake_call_(webrtc::Call::Config(&event_log_)),
380 tdesc_factory_(new cricket::TransportDescriptionFactory()), 384 tdesc_factory_(new cricket::TransportDescriptionFactory()),
381 desc_factory_( 385 desc_factory_(
382 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), 386 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(),
383 tdesc_factory_.get())), 387 tdesc_factory_.get())),
384 pss_(new rtc::PhysicalSocketServer),
385 vss_(new rtc::VirtualSocketServer(pss_.get())),
386 fss_(new rtc::FirewallSocketServer(vss_.get())),
387 ss_scope_(fss_.get()),
388 stun_socket_addr_( 388 stun_socket_addr_(
389 rtc::SocketAddress(kStunAddrHost, cricket::STUN_SERVER_PORT)), 389 rtc::SocketAddress(kStunAddrHost, cricket::STUN_SERVER_PORT)),
390 stun_server_(cricket::TestStunServer::Create(Thread::Current(), 390 stun_server_(cricket::TestStunServer::Create(Thread::Current(),
391 stun_socket_addr_)), 391 stun_socket_addr_)),
392 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), 392 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr),
393 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { 393 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) {
394 cricket::ServerAddresses stun_servers; 394 cricket::ServerAddresses stun_servers;
395 stun_servers.insert(stun_socket_addr_); 395 stun_servers.insert(stun_socket_addr_);
396 allocator_.reset(new cricket::BasicPortAllocator( 396 allocator_.reset(new cricket::BasicPortAllocator(
397 &network_manager_, 397 &network_manager_,
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); 1496 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword);
1497 turn_server.credentials = credentials; 1497 turn_server.credentials = credentials;
1498 turn_server.ports.push_back( 1498 turn_server.ports.push_back(
1499 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP)); 1499 cricket::ProtocolAddress(kTurnUdpIntAddr, cricket::PROTO_UDP));
1500 allocator_->AddTurnServer(turn_server); 1500 allocator_->AddTurnServer(turn_server);
1501 allocator_->set_step_delay(cricket::kMinimumStepDelay); 1501 allocator_->set_step_delay(cricket::kMinimumStepDelay);
1502 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); 1502 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP);
1503 } 1503 }
1504 1504
1505 webrtc::RtcEventLogNullImpl event_log_; 1505 webrtc::RtcEventLogNullImpl event_log_;
1506 std::unique_ptr<rtc::PhysicalSocketServer> pss_;
1507 std::unique_ptr<rtc::VirtualSocketServer> vss_;
1508 std::unique_ptr<rtc::FirewallSocketServer> fss_;
1509 rtc::AutoSocketServerThread thread_;
1506 // |media_engine_| and |data_engine_| are actually owned by 1510 // |media_engine_| and |data_engine_| are actually owned by
1507 // |channel_manager_|. 1511 // |channel_manager_|.
1508 cricket::FakeMediaEngine* media_engine_; 1512 cricket::FakeMediaEngine* media_engine_;
1509 cricket::FakeDataEngine* data_engine_; 1513 cricket::FakeDataEngine* data_engine_;
1510 // Actually owned by session_. 1514 // Actually owned by session_.
1511 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr; 1515 FakeSctpTransportFactory* fake_sctp_transport_factory_ = nullptr;
1512 std::unique_ptr<cricket::ChannelManager> channel_manager_; 1516 std::unique_ptr<cricket::ChannelManager> channel_manager_;
1513 cricket::FakeCall fake_call_; 1517 cricket::FakeCall fake_call_;
1514 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; 1518 std::unique_ptr<cricket::TransportDescriptionFactory> tdesc_factory_;
1515 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; 1519 std::unique_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_;
1516 std::unique_ptr<rtc::PhysicalSocketServer> pss_;
1517 std::unique_ptr<rtc::VirtualSocketServer> vss_;
1518 std::unique_ptr<rtc::FirewallSocketServer> fss_;
1519 rtc::SocketServerScope ss_scope_;
1520 rtc::SocketAddress stun_socket_addr_; 1520 rtc::SocketAddress stun_socket_addr_;
1521 std::unique_ptr<cricket::TestStunServer> stun_server_; 1521 std::unique_ptr<cricket::TestStunServer> stun_server_;
1522 cricket::TestTurnServer turn_server_; 1522 cricket::TestTurnServer turn_server_;
1523 rtc::FakeNetworkManager network_manager_; 1523 rtc::FakeNetworkManager network_manager_;
1524 std::unique_ptr<cricket::BasicPortAllocator> allocator_; 1524 std::unique_ptr<cricket::BasicPortAllocator> allocator_;
1525 PeerConnectionFactoryInterface::Options options_; 1525 PeerConnectionFactoryInterface::Options options_;
1526 PeerConnectionInterface::RTCConfiguration configuration_; 1526 PeerConnectionInterface::RTCConfiguration configuration_;
1527 std::unique_ptr<WebRtcSessionForTest> session_; 1527 std::unique_ptr<WebRtcSessionForTest> session_;
1528 MockIceObserver observer_; 1528 MockIceObserver observer_;
1529 cricket::FakeVideoMediaChannel* video_channel_; 1529 cricket::FakeVideoMediaChannel* video_channel_;
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 } 4342 }
4343 4343
4344 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4344 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4345 // currently fails because upon disconnection and reconnection OnIceComplete is 4345 // currently fails because upon disconnection and reconnection OnIceComplete is
4346 // called more than once without returning to IceGatheringGathering. 4346 // called more than once without returning to IceGatheringGathering.
4347 4347
4348 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4348 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4349 WebRtcSessionTest, 4349 WebRtcSessionTest,
4350 testing::Values(ALREADY_GENERATED, 4350 testing::Values(ALREADY_GENERATED,
4351 DTLS_IDENTITY_STORE)); 4351 DTLS_IDENTITY_STORE));
OLDNEW
« no previous file with comments | « webrtc/p2p/stunprober/stunprober_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698