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

Side by Side Diff: talk/app/webrtc/webrtcsession_unittest.cc

Issue 1346153002: Remove use of DeviceManager from ChannelManager. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 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 * 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 22 matching lines...) Expand all
33 #include "talk/app/webrtc/streamcollection.h" 33 #include "talk/app/webrtc/streamcollection.h"
34 #include "talk/app/webrtc/test/fakeconstraints.h" 34 #include "talk/app/webrtc/test/fakeconstraints.h"
35 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" 35 #include "talk/app/webrtc/test/fakedtlsidentitystore.h"
36 #include "talk/app/webrtc/test/fakemediastreamsignaling.h" 36 #include "talk/app/webrtc/test/fakemediastreamsignaling.h"
37 #include "talk/app/webrtc/videotrack.h" 37 #include "talk/app/webrtc/videotrack.h"
38 #include "talk/app/webrtc/webrtcsession.h" 38 #include "talk/app/webrtc/webrtcsession.h"
39 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h" 39 #include "talk/app/webrtc/webrtcsessiondescriptionfactory.h"
40 #include "talk/media/base/fakemediaengine.h" 40 #include "talk/media/base/fakemediaengine.h"
41 #include "talk/media/base/fakevideorenderer.h" 41 #include "talk/media/base/fakevideorenderer.h"
42 #include "talk/media/base/mediachannel.h" 42 #include "talk/media/base/mediachannel.h"
43 #include "talk/media/devices/fakedevicemanager.h"
44 #include "webrtc/p2p/base/stunserver.h" 43 #include "webrtc/p2p/base/stunserver.h"
45 #include "webrtc/p2p/base/teststunserver.h" 44 #include "webrtc/p2p/base/teststunserver.h"
46 #include "webrtc/p2p/base/testturnserver.h" 45 #include "webrtc/p2p/base/testturnserver.h"
47 #include "webrtc/p2p/base/transportchannel.h" 46 #include "webrtc/p2p/base/transportchannel.h"
48 #include "webrtc/p2p/client/basicportallocator.h" 47 #include "webrtc/p2p/client/basicportallocator.h"
49 #include "talk/session/media/channelmanager.h" 48 #include "talk/session/media/channelmanager.h"
50 #include "talk/session/media/mediasession.h" 49 #include "talk/session/media/mediasession.h"
51 #include "webrtc/base/fakenetwork.h" 50 #include "webrtc/base/fakenetwork.h"
52 #include "webrtc/base/firewallsocketserver.h" 51 #include "webrtc/base/firewallsocketserver.h"
53 #include "webrtc/base/gunit.h" 52 #include "webrtc/base/gunit.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 }; 312 };
314 313
315 class WebRtcSessionTest 314 class WebRtcSessionTest
316 : public testing::TestWithParam<RTCCertificateGenerationMethod> { 315 : public testing::TestWithParam<RTCCertificateGenerationMethod> {
317 protected: 316 protected:
318 // TODO Investigate why ChannelManager crashes, if it's created 317 // TODO Investigate why ChannelManager crashes, if it's created
319 // after stun_server. 318 // after stun_server.
320 WebRtcSessionTest() 319 WebRtcSessionTest()
321 : media_engine_(new cricket::FakeMediaEngine()), 320 : media_engine_(new cricket::FakeMediaEngine()),
322 data_engine_(new cricket::FakeDataEngine()), 321 data_engine_(new cricket::FakeDataEngine()),
323 device_manager_(new cricket::FakeDeviceManager()),
324 channel_manager_(new cricket::ChannelManager( 322 channel_manager_(new cricket::ChannelManager(
325 media_engine_, data_engine_, device_manager_, 323 media_engine_, data_engine_, new cricket::CaptureManager(),
326 new cricket::CaptureManager(), rtc::Thread::Current())), 324 rtc::Thread::Current())),
327 tdesc_factory_(new cricket::TransportDescriptionFactory()), 325 tdesc_factory_(new cricket::TransportDescriptionFactory()),
328 desc_factory_(new cricket::MediaSessionDescriptionFactory( 326 desc_factory_(new cricket::MediaSessionDescriptionFactory(
329 channel_manager_.get(), tdesc_factory_.get())), 327 channel_manager_.get(), tdesc_factory_.get())),
330 pss_(new rtc::PhysicalSocketServer), 328 pss_(new rtc::PhysicalSocketServer),
331 vss_(new rtc::VirtualSocketServer(pss_.get())), 329 vss_(new rtc::VirtualSocketServer(pss_.get())),
332 fss_(new rtc::FirewallSocketServer(vss_.get())), 330 fss_(new rtc::FirewallSocketServer(vss_.get())),
333 ss_scope_(fss_.get()), 331 ss_scope_(fss_.get()),
334 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, 332 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost,
335 cricket::STUN_SERVER_PORT)), 333 cricket::STUN_SERVER_PORT)),
336 stun_server_(cricket::TestStunServer::Create(Thread::Current(), 334 stun_server_(cricket::TestStunServer::Create(Thread::Current(),
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 relay_server.credentials = credentials; 1266 relay_server.credentials = credentials;
1269 relay_server.ports.push_back(cricket::ProtocolAddress( 1267 relay_server.ports.push_back(cricket::ProtocolAddress(
1270 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); 1268 kTurnUdpIntAddr, cricket::PROTO_UDP, false));
1271 allocator_->AddRelay(relay_server); 1269 allocator_->AddRelay(relay_server);
1272 allocator_->set_step_delay(cricket::kMinimumStepDelay); 1270 allocator_->set_step_delay(cricket::kMinimumStepDelay);
1273 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); 1271 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP);
1274 } 1272 }
1275 1273
1276 cricket::FakeMediaEngine* media_engine_; 1274 cricket::FakeMediaEngine* media_engine_;
1277 cricket::FakeDataEngine* data_engine_; 1275 cricket::FakeDataEngine* data_engine_;
1278 cricket::FakeDeviceManager* device_manager_;
1279 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; 1276 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
1280 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; 1277 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_;
1281 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; 1278 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_;
1282 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; 1279 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_;
1283 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; 1280 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_;
1284 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; 1281 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_;
1285 rtc::SocketServerScope ss_scope_; 1282 rtc::SocketServerScope ss_scope_;
1286 rtc::SocketAddress stun_socket_addr_; 1283 rtc::SocketAddress stun_socket_addr_;
1287 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; 1284 rtc::scoped_ptr<cricket::TestStunServer> stun_server_;
1288 cricket::TestTurnServer turn_server_; 1285 cricket::TestTurnServer turn_server_;
(...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after
3937 } 3934 }
3938 } 3935 }
3939 3936
3940 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 3937 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
3941 // currently fails because upon disconnection and reconnection OnIceComplete is 3938 // currently fails because upon disconnection and reconnection OnIceComplete is
3942 // called more than once without returning to IceGatheringGathering. 3939 // called more than once without returning to IceGatheringGathering.
3943 3940
3944 INSTANTIATE_TEST_CASE_P( 3941 INSTANTIATE_TEST_CASE_P(
3945 WebRtcSessionTests, WebRtcSessionTest, 3942 WebRtcSessionTests, WebRtcSessionTest,
3946 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE)); 3943 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698