Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 #include "webrtc/base/logging.h" | 50 #include "webrtc/base/logging.h" |
| 51 #include "webrtc/base/network.h" | 51 #include "webrtc/base/network.h" |
| 52 #include "webrtc/base/physicalsocketserver.h" | 52 #include "webrtc/base/physicalsocketserver.h" |
| 53 #include "webrtc/base/ssladapter.h" | 53 #include "webrtc/base/ssladapter.h" |
| 54 #include "webrtc/base/sslidentity.h" | 54 #include "webrtc/base/sslidentity.h" |
| 55 #include "webrtc/base/sslstreamadapter.h" | 55 #include "webrtc/base/sslstreamadapter.h" |
| 56 #include "webrtc/base/stringutils.h" | 56 #include "webrtc/base/stringutils.h" |
| 57 #include "webrtc/base/thread.h" | 57 #include "webrtc/base/thread.h" |
| 58 #include "webrtc/base/virtualsocketserver.h" | 58 #include "webrtc/base/virtualsocketserver.h" |
| 59 #include "webrtc/media/base/fakemediaengine.h" | 59 #include "webrtc/media/base/fakemediaengine.h" |
| 60 #include "webrtc/media/base/fakenetworkinterface.h" | |
|
perkj_webrtc
2016/02/11 08:04:06
used?
nisse-webrtc
2016/02/11 09:16:00
Done.
| |
| 60 #include "webrtc/media/base/fakevideorenderer.h" | 61 #include "webrtc/media/base/fakevideorenderer.h" |
| 61 #include "webrtc/media/base/mediachannel.h" | 62 #include "webrtc/media/base/mediachannel.h" |
| 62 #include "webrtc/media/webrtc/fakewebrtccall.h" | 63 #include "webrtc/media/webrtc/fakewebrtccall.h" |
| 63 #include "webrtc/p2p/base/stunserver.h" | 64 #include "webrtc/p2p/base/stunserver.h" |
| 64 #include "webrtc/p2p/base/teststunserver.h" | 65 #include "webrtc/p2p/base/teststunserver.h" |
| 65 #include "webrtc/p2p/base/testturnserver.h" | 66 #include "webrtc/p2p/base/testturnserver.h" |
| 66 #include "webrtc/p2p/base/transportchannel.h" | 67 #include "webrtc/p2p/base/transportchannel.h" |
| 67 #include "webrtc/p2p/client/basicportallocator.h" | 68 #include "webrtc/p2p/client/basicportallocator.h" |
| 68 | 69 |
| 69 #define MAYBE_SKIP_TEST(feature) \ | 70 #define MAYBE_SKIP_TEST(feature) \ |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 WebRtcSessionTest() | 357 WebRtcSessionTest() |
| 357 : media_engine_(new cricket::FakeMediaEngine()), | 358 : media_engine_(new cricket::FakeMediaEngine()), |
| 358 data_engine_(new cricket::FakeDataEngine()), | 359 data_engine_(new cricket::FakeDataEngine()), |
| 359 channel_manager_( | 360 channel_manager_( |
| 360 new cricket::ChannelManager(media_engine_, | 361 new cricket::ChannelManager(media_engine_, |
| 361 data_engine_, | 362 data_engine_, |
| 362 new cricket::CaptureManager(), | 363 new cricket::CaptureManager(), |
| 363 rtc::Thread::Current())), | 364 rtc::Thread::Current())), |
| 364 fake_call_(webrtc::Call::Config()), | 365 fake_call_(webrtc::Call::Config()), |
| 365 media_controller_( | 366 media_controller_( |
| 366 webrtc::MediaControllerInterface::Create(rtc::Thread::Current(), | 367 webrtc::MediaControllerInterface::Create(cricket::MediaConfig(), |
| 368 rtc::Thread::Current(), | |
| 367 channel_manager_.get())), | 369 channel_manager_.get())), |
| 368 tdesc_factory_(new cricket::TransportDescriptionFactory()), | 370 tdesc_factory_(new cricket::TransportDescriptionFactory()), |
| 369 desc_factory_( | 371 desc_factory_( |
| 370 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), | 372 new cricket::MediaSessionDescriptionFactory(channel_manager_.get(), |
| 371 tdesc_factory_.get())), | 373 tdesc_factory_.get())), |
| 372 pss_(new rtc::PhysicalSocketServer), | 374 pss_(new rtc::PhysicalSocketServer), |
| 373 vss_(new rtc::VirtualSocketServer(pss_.get())), | 375 vss_(new rtc::VirtualSocketServer(pss_.get())), |
| 374 fss_(new rtc::FirewallSocketServer(vss_.get())), | 376 fss_(new rtc::FirewallSocketServer(vss_.get())), |
| 375 ss_scope_(fss_.get()), | 377 ss_scope_(fss_.get()), |
| 376 stun_socket_addr_( | 378 stun_socket_addr_( |
| (...skipping 3689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4066 TransportInfo* audio = sdp->GetTransportInfoByName("audio"); | 4068 TransportInfo* audio = sdp->GetTransportInfoByName("audio"); |
| 4067 ASSERT_TRUE(audio != NULL); | 4069 ASSERT_TRUE(audio != NULL); |
| 4068 ASSERT_TRUE(audio->description.identity_fingerprint.get() == NULL); | 4070 ASSERT_TRUE(audio->description.identity_fingerprint.get() == NULL); |
| 4069 audio->description.identity_fingerprint.reset( | 4071 audio->description.identity_fingerprint.reset( |
| 4070 rtc::SSLFingerprint::CreateFromRfc4572( | 4072 rtc::SSLFingerprint::CreateFromRfc4572( |
| 4071 rtc::DIGEST_SHA_256, kFakeDtlsFingerprint)); | 4073 rtc::DIGEST_SHA_256, kFakeDtlsFingerprint)); |
| 4072 SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto, | 4074 SetRemoteDescriptionOfferExpectError(kSdpWithoutSdesCrypto, |
| 4073 offer); | 4075 offer); |
| 4074 } | 4076 } |
| 4075 | 4077 |
| 4076 // This test verifies DSCP is properly applied on the media channels. | |
| 4077 TEST_F(WebRtcSessionTest, TestDscpConstraint) { | |
| 4078 constraints_.reset(new FakeConstraints()); | |
| 4079 constraints_->AddOptional( | |
| 4080 webrtc::MediaConstraintsInterface::kEnableDscp, true); | |
| 4081 Init(); | |
| 4082 SendAudioVideoStream1(); | |
| 4083 SessionDescriptionInterface* offer = CreateOffer(); | |
| 4084 | |
| 4085 SetLocalDescriptionWithoutError(offer); | |
| 4086 | |
| 4087 video_channel_ = media_engine_->GetVideoChannel(0); | |
| 4088 voice_channel_ = media_engine_->GetVoiceChannel(0); | |
| 4089 | |
| 4090 ASSERT_TRUE(video_channel_ != NULL); | |
| 4091 ASSERT_TRUE(voice_channel_ != NULL); | |
| 4092 const cricket::AudioOptions& audio_options = voice_channel_->options(); | |
| 4093 const cricket::VideoOptions& video_options = video_channel_->options(); | |
| 4094 EXPECT_EQ(rtc::Optional<bool>(true), audio_options.dscp); | |
| 4095 EXPECT_EQ(rtc::Optional<bool>(true), video_options.dscp); | |
| 4096 } | |
| 4097 | |
| 4098 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { | 4078 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { |
| 4099 constraints_.reset(new FakeConstraints()); | 4079 constraints_.reset(new FakeConstraints()); |
| 4100 constraints_->AddOptional( | 4080 constraints_->AddOptional( |
| 4101 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 4081 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
| 4102 true); | 4082 true); |
| 4103 Init(); | 4083 Init(); |
| 4104 SendAudioVideoStream1(); | 4084 SendAudioVideoStream1(); |
| 4105 SessionDescriptionInterface* offer = CreateOffer(); | 4085 SessionDescriptionInterface* offer = CreateOffer(); |
| 4106 | 4086 |
| 4107 SetLocalDescriptionWithoutError(offer); | 4087 SetLocalDescriptionWithoutError(offer); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4310 } | 4290 } |
| 4311 | 4291 |
| 4312 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4292 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4313 // currently fails because upon disconnection and reconnection OnIceComplete is | 4293 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4314 // called more than once without returning to IceGatheringGathering. | 4294 // called more than once without returning to IceGatheringGathering. |
| 4315 | 4295 |
| 4316 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4296 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4317 WebRtcSessionTest, | 4297 WebRtcSessionTest, |
| 4318 testing::Values(ALREADY_GENERATED, | 4298 testing::Values(ALREADY_GENERATED, |
| 4319 DTLS_IDENTITY_STORE)); | 4299 DTLS_IDENTITY_STORE)); |
| OLD | NEW |