| OLD | NEW |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 namespace webrtc { | 55 namespace webrtc { |
| 56 | 56 |
| 57 class RtpSenderReceiverTest : public testing::Test, | 57 class RtpSenderReceiverTest : public testing::Test, |
| 58 public sigslot::has_slots<> { | 58 public sigslot::has_slots<> { |
| 59 public: | 59 public: |
| 60 RtpSenderReceiverTest() | 60 RtpSenderReceiverTest() |
| 61 : // Create fake media engine/etc. so we can create channels to use to | 61 : // Create fake media engine/etc. so we can create channels to use to |
| 62 // test RtpSenders/RtpReceivers. | 62 // test RtpSenders/RtpReceivers. |
| 63 media_engine_(new cricket::FakeMediaEngine()), | 63 media_engine_(new cricket::FakeMediaEngine()), |
| 64 channel_manager_(media_engine_, | 64 channel_manager_( |
| 65 rtc::Thread::Current(), | 65 std::unique_ptr<cricket::MediaEngineInterface>(media_engine_), |
| 66 rtc::Thread::Current()), | 66 rtc::Thread::Current(), |
| 67 rtc::Thread::Current()), |
| 67 fake_call_(Call::Config(&event_log_)), | 68 fake_call_(Call::Config(&event_log_)), |
| 68 fake_media_controller_(&channel_manager_, &fake_call_), | 69 fake_media_controller_(&channel_manager_, &fake_call_), |
| 69 stream_(MediaStream::Create(kStreamLabel1)) { | 70 stream_(MediaStream::Create(kStreamLabel1)) { |
| 70 // Create channels to be used by the RtpSenders and RtpReceivers. | 71 // Create channels to be used by the RtpSenders and RtpReceivers. |
| 71 channel_manager_.Init(); | 72 channel_manager_.Init(); |
| 72 bool rtcp_mux_required = true; | 73 bool rtcp_mux_required = true; |
| 73 bool srtp_required = true; | 74 bool srtp_required = true; |
| 74 cricket::DtlsTransportInternal* rtp_transport = | 75 cricket::DtlsTransportInternal* rtp_transport = |
| 75 fake_transport_controller_.CreateDtlsTransport( | 76 fake_transport_controller_.CreateDtlsTransport( |
| 76 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); | 77 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 EXPECT_EQ(0, volume); | 245 EXPECT_EQ(0, volume); |
| 245 } | 246 } |
| 246 | 247 |
| 247 void VerifyVideoChannelNoOutput() { | 248 void VerifyVideoChannelNoOutput() { |
| 248 // Verify that the media channel's sink is reset. | 249 // Verify that the media channel's sink is reset. |
| 249 EXPECT_FALSE(video_media_channel_->HasSink(kVideoSsrc)); | 250 EXPECT_FALSE(video_media_channel_->HasSink(kVideoSsrc)); |
| 250 } | 251 } |
| 251 | 252 |
| 252 protected: | 253 protected: |
| 253 webrtc::RtcEventLogNullImpl event_log_; | 254 webrtc::RtcEventLogNullImpl event_log_; |
| 255 // |media_engine_| is actually owned by |channel_manager_|. |
| 254 cricket::FakeMediaEngine* media_engine_; | 256 cricket::FakeMediaEngine* media_engine_; |
| 255 cricket::FakeTransportController fake_transport_controller_; | 257 cricket::FakeTransportController fake_transport_controller_; |
| 256 cricket::ChannelManager channel_manager_; | 258 cricket::ChannelManager channel_manager_; |
| 257 cricket::FakeCall fake_call_; | 259 cricket::FakeCall fake_call_; |
| 258 cricket::FakeMediaController fake_media_controller_; | 260 cricket::FakeMediaController fake_media_controller_; |
| 259 cricket::VoiceChannel* voice_channel_; | 261 cricket::VoiceChannel* voice_channel_; |
| 260 cricket::VideoChannel* video_channel_; | 262 cricket::VideoChannel* video_channel_; |
| 261 cricket::FakeVoiceMediaChannel* voice_media_channel_; | 263 cricket::FakeVoiceMediaChannel* voice_media_channel_; |
| 262 cricket::FakeVideoMediaChannel* video_media_channel_; | 264 cricket::FakeVideoMediaChannel* video_media_channel_; |
| 263 rtc::scoped_refptr<AudioRtpSender> audio_rtp_sender_; | 265 rtc::scoped_refptr<AudioRtpSender> audio_rtp_sender_; |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 // Make sure the signal from "GetOnDestroyedSignal()" fires when the sender is | 800 // Make sure the signal from "GetOnDestroyedSignal()" fires when the sender is |
| 799 // destroyed, which is needed for the DTMF sender. | 801 // destroyed, which is needed for the DTMF sender. |
| 800 TEST_F(RtpSenderReceiverTest, TestOnDestroyedSignal) { | 802 TEST_F(RtpSenderReceiverTest, TestOnDestroyedSignal) { |
| 801 CreateAudioRtpSender(); | 803 CreateAudioRtpSender(); |
| 802 EXPECT_FALSE(audio_sender_destroyed_signal_fired_); | 804 EXPECT_FALSE(audio_sender_destroyed_signal_fired_); |
| 803 audio_rtp_sender_ = nullptr; | 805 audio_rtp_sender_ = nullptr; |
| 804 EXPECT_TRUE(audio_sender_destroyed_signal_fired_); | 806 EXPECT_TRUE(audio_sender_destroyed_signal_fired_); |
| 805 } | 807 } |
| 806 | 808 |
| 807 } // namespace webrtc | 809 } // namespace webrtc |
| OLD | NEW |