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

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

Issue 2653343003: Add CreatePeerConnectionFactory overloads that take audio codec factory args (Closed)
Patch Set: We need actual factories Created 3 years, 10 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/pc/peerconnectionfactory.cc ('k') | webrtc/pc/test/mock_peerconnection.h » ('j') | 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
11 #include <memory> 11 #include <memory>
12 #include <sstream> 12 #include <sstream>
13 #include <string> 13 #include <string>
14 #include <utility> 14 #include <utility>
15 15
16 #include "webrtc/api/jsepsessiondescription.h" 16 #include "webrtc/api/jsepsessiondescription.h"
17 #include "webrtc/api/mediastreaminterface.h" 17 #include "webrtc/api/mediastreaminterface.h"
18 #include "webrtc/api/peerconnectioninterface.h" 18 #include "webrtc/api/peerconnectioninterface.h"
19 #include "webrtc/api/rtpreceiverinterface.h" 19 #include "webrtc/api/rtpreceiverinterface.h"
20 #include "webrtc/api/rtpsenderinterface.h" 20 #include "webrtc/api/rtpsenderinterface.h"
21 #include "webrtc/api/test/fakeconstraints.h" 21 #include "webrtc/api/test/fakeconstraints.h"
22 #include "webrtc/base/gunit.h" 22 #include "webrtc/base/gunit.h"
23 #include "webrtc/base/ssladapter.h" 23 #include "webrtc/base/ssladapter.h"
24 #include "webrtc/base/sslstreamadapter.h" 24 #include "webrtc/base/sslstreamadapter.h"
25 #include "webrtc/base/stringutils.h" 25 #include "webrtc/base/stringutils.h"
26 #include "webrtc/base/thread.h" 26 #include "webrtc/base/thread.h"
27 #include "webrtc/media/base/fakevideocapturer.h" 27 #include "webrtc/media/base/fakevideocapturer.h"
28 #include "webrtc/media/sctp/sctptransportinternal.h" 28 #include "webrtc/media/sctp/sctptransportinternal.h"
29 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
29 #include "webrtc/p2p/base/fakeportallocator.h" 30 #include "webrtc/p2p/base/fakeportallocator.h"
30 #include "webrtc/pc/audiotrack.h" 31 #include "webrtc/pc/audiotrack.h"
31 #include "webrtc/pc/mediasession.h" 32 #include "webrtc/pc/mediasession.h"
32 #include "webrtc/pc/mediastream.h" 33 #include "webrtc/pc/mediastream.h"
33 #include "webrtc/pc/peerconnection.h" 34 #include "webrtc/pc/peerconnection.h"
34 #include "webrtc/pc/streamcollection.h" 35 #include "webrtc/pc/streamcollection.h"
35 #include "webrtc/pc/test/fakertccertificategenerator.h" 36 #include "webrtc/pc/test/fakertccertificategenerator.h"
36 #include "webrtc/pc/test/fakevideotracksource.h" 37 #include "webrtc/pc/test/fakevideotracksource.h"
37 #include "webrtc/pc/test/mockpeerconnectionobservers.h" 38 #include "webrtc/pc/test/mockpeerconnectionobservers.h"
38 #include "webrtc/pc/test/testsdpstrings.h" 39 #include "webrtc/pc/test/testsdpstrings.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 }; 659 };
659 660
660 } // namespace 661 } // namespace
661 662
662 // The PeerConnectionMediaConfig tests below verify that configuration 663 // The PeerConnectionMediaConfig tests below verify that configuration
663 // and constraints are propagated into the MediaConfig passed to 664 // and constraints are propagated into the MediaConfig passed to
664 // CreateMediaController. These settings are intended for MediaChannel 665 // CreateMediaController. These settings are intended for MediaChannel
665 // constructors, but that is not exercised by these unittest. 666 // constructors, but that is not exercised by these unittest.
666 class PeerConnectionFactoryForTest : public webrtc::PeerConnectionFactory { 667 class PeerConnectionFactoryForTest : public webrtc::PeerConnectionFactory {
667 public: 668 public:
669 PeerConnectionFactoryForTest()
670 : webrtc::PeerConnectionFactory(
671 webrtc::CreateBuiltinAudioEncoderFactory(),
672 webrtc::CreateBuiltinAudioDecoderFactory()) {}
673
668 webrtc::MediaControllerInterface* CreateMediaController( 674 webrtc::MediaControllerInterface* CreateMediaController(
669 const cricket::MediaConfig& config, 675 const cricket::MediaConfig& config,
670 webrtc::RtcEventLog* event_log) const override { 676 webrtc::RtcEventLog* event_log) const override {
671 create_media_controller_called_ = true; 677 create_media_controller_called_ = true;
672 create_media_controller_config_ = config; 678 create_media_controller_config_ = config;
673 679
674 webrtc::MediaControllerInterface* mc = 680 webrtc::MediaControllerInterface* mc =
675 PeerConnectionFactory::CreateMediaController(config, event_log); 681 PeerConnectionFactory::CreateMediaController(config, event_log);
676 EXPECT_TRUE(mc != nullptr); 682 EXPECT_TRUE(mc != nullptr);
677 return mc; 683 return mc;
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
3395 EXPECT_NE(a, f); 3401 EXPECT_NE(a, f);
3396 3402
3397 PeerConnectionInterface::RTCConfiguration g; 3403 PeerConnectionInterface::RTCConfiguration g;
3398 g.disable_ipv6 = true; 3404 g.disable_ipv6 = true;
3399 EXPECT_NE(a, g); 3405 EXPECT_NE(a, g);
3400 3406
3401 PeerConnectionInterface::RTCConfiguration h( 3407 PeerConnectionInterface::RTCConfiguration h(
3402 PeerConnectionInterface::RTCConfigurationType::kAggressive); 3408 PeerConnectionInterface::RTCConfigurationType::kAggressive);
3403 EXPECT_NE(a, h); 3409 EXPECT_NE(a, h);
3404 } 3410 }
OLDNEW
« no previous file with comments | « webrtc/pc/peerconnectionfactory.cc ('k') | webrtc/pc/test/mock_peerconnection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698