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

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

Issue 1670153003: Introduce struct MediaConfig, with construction-time settings. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed test nit; use reference. Created 4 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/api/webrtcsession.cc ('k') | webrtc/media/base/fakemediaengine.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
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 WebRtcSessionTest() 322 WebRtcSessionTest()
323 : media_engine_(new cricket::FakeMediaEngine()), 323 : media_engine_(new cricket::FakeMediaEngine()),
324 data_engine_(new cricket::FakeDataEngine()), 324 data_engine_(new cricket::FakeDataEngine()),
325 channel_manager_( 325 channel_manager_(
326 new cricket::ChannelManager(media_engine_, 326 new cricket::ChannelManager(media_engine_,
327 data_engine_, 327 data_engine_,
328 new cricket::CaptureManager(), 328 new cricket::CaptureManager(),
329 rtc::Thread::Current())), 329 rtc::Thread::Current())),
330 fake_call_(webrtc::Call::Config()), 330 fake_call_(webrtc::Call::Config()),
331 media_controller_( 331 media_controller_(
332 webrtc::MediaControllerInterface::Create(rtc::Thread::Current(), 332 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(),
333 rtc::Thread::Current(),
333 channel_manager_.get())), 334 channel_manager_.get())),
334 tdesc_factory_(new cricket::TransportDescriptionFactory()), 335 tdesc_factory_(new cricket::TransportDescriptionFactory()),
335 desc_factory_( 336 desc_factory_(
336 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), 337 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(),
337 tdesc_factory_.get())), 338 tdesc_factory_.get())),
338 pss_(new rtc::PhysicalSocketServer), 339 pss_(new rtc::PhysicalSocketServer),
339 vss_(new rtc::VirtualSocketServer(pss_.get())), 340 vss_(new rtc::VirtualSocketServer(pss_.get())),
340 fss_(new rtc::FirewallSocketServer(vss_.get())), 341 fss_(new rtc::FirewallSocketServer(vss_.get())),
341 ss_scope_(fss_.get()), 342 ss_scope_(fss_.get()),
342 stun_socket_addr_( 343 stun_socket_addr_(
(...skipping 3689 matching lines...) Expand 10 before | Expand all | Expand 10 after
4032 TransportInfo* audio = sdp->GetTransportInfoByName("audio"); 4033 TransportInfo* audio = sdp->GetTransportInfoByName("audio");
4033 ASSERT_TRUE(audio != NULL); 4034 ASSERT_TRUE(audio != NULL);
4034 ASSERT_TRUE(audio->description.identity_fingerprint.get() == NULL); 4035 ASSERT_TRUE(audio->description.identity_fingerprint.get() == NULL);
4035 audio->description.identity_fingerprint.reset( 4036 audio->description.identity_fingerprint.reset(
4036 rtc::SSLFingerprint::CreateFromRfc4572( 4037 rtc::SSLFingerprint::CreateFromRfc4572(
4037 rtc::DIGEST_SHA_256, kFakeDtlsFingerprint)); 4038 rtc::DIGEST_SHA_256, kFakeDtlsFingerprint));
4038 SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto, 4039 SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto,
4039 offer); 4040 offer);
4040 } 4041 }
4041 4042
4042 // This test verifies DSCP is properly applied on the media channels.
4043 TEST_F(WebRtcSessionTest, TestDscpConstraint) {
4044 constraints_.reset(new FakeConstraints());
4045 constraints_->AddOptional(
4046 webrtc::MediaConstraintsInterface::kEnableDscp, true);
4047 Init();
4048 SendAudioVideoStream1();
4049 SessionDescriptionInterface* offer = CreateOffer();
4050
4051 SetLocalDescriptionWithoutError(offer);
4052
4053 video_channel_ = media_engine_->GetVideoChannel(0);
4054 voice_channel_ = media_engine_->GetVoiceChannel(0);
4055
4056 ASSERT_TRUE(video_channel_ != NULL);
4057 ASSERT_TRUE(voice_channel_ != NULL);
4058 const cricket::AudioOptions& audio_options = voice_channel_->options();
4059 const cricket::VideoOptions& video_options = video_channel_->options();
4060 EXPECT_EQ(rtc::Optional<bool>(true), audio_options.dscp);
4061 EXPECT_EQ(rtc::Optional<bool>(true), video_options.dscp);
4062 }
4063
4064 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { 4043 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) {
4065 constraints_.reset(new FakeConstraints()); 4044 constraints_.reset(new FakeConstraints());
4066 constraints_->AddOptional( 4045 constraints_->AddOptional(
4067 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, 4046 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate,
4068 true); 4047 true);
4069 Init(); 4048 Init();
4070 SendAudioVideoStream1(); 4049 SendAudioVideoStream1();
4071 SessionDescriptionInterface* offer = CreateOffer(); 4050 SessionDescriptionInterface* offer = CreateOffer();
4072 4051
4073 SetLocalDescriptionWithoutError(offer); 4052 SetLocalDescriptionWithoutError(offer);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
4276 } 4255 }
4277 4256
4278 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4257 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4279 // currently fails because upon disconnection and reconnection OnIceComplete is 4258 // currently fails because upon disconnection and reconnection OnIceComplete is
4280 // called more than once without returning to IceGatheringGathering. 4259 // called more than once without returning to IceGatheringGathering.
4281 4260
4282 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4261 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4283 WebRtcSessionTest, 4262 WebRtcSessionTest,
4284 testing::Values(ALREADY_GENERATED, 4263 testing::Values(ALREADY_GENERATED,
4285 DTLS_IDENTITY_STORE)); 4264 DTLS_IDENTITY_STORE));
OLDNEW
« no previous file with comments | « webrtc/api/webrtcsession.cc ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698