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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 session_.reset(); | 616 session_.reset(); |
617 Init(); | 617 Init(); |
618 mediastream_signaling_.SendAudioVideoStream1(); | 618 mediastream_signaling_.SendAudioVideoStream1(); |
619 SessionDescriptionInterface* offer = CreateOffer(); | 619 SessionDescriptionInterface* offer = CreateOffer(); |
620 | 620 |
621 SetLocalDescriptionWithoutError(offer); | 621 SetLocalDescriptionWithoutError(offer); |
622 | 622 |
623 video_channel_ = media_engine_->GetVideoChannel(0); | 623 video_channel_ = media_engine_->GetVideoChannel(0); |
624 | 624 |
625 ASSERT_TRUE(video_channel_ != NULL); | 625 ASSERT_TRUE(video_channel_ != NULL); |
626 cricket::VideoOptions video_options; | 626 const cricket::VideoOptions& video_options = video_channel_->options(); |
627 EXPECT_TRUE(video_channel_->GetOptions(&video_options)); | |
628 EXPECT_EQ(value_expected, | 627 EXPECT_EQ(value_expected, |
629 video_options.unsignalled_recv_stream_limit.GetWithDefaultIfUnset(-1)); | 628 video_options.unsignalled_recv_stream_limit.GetWithDefaultIfUnset(-1)); |
630 } | 629 } |
631 | 630 |
632 void CompareIceUfragAndPassword(const cricket::SessionDescription* desc1, | 631 void CompareIceUfragAndPassword(const cricket::SessionDescription* desc1, |
633 const cricket::SessionDescription* desc2, | 632 const cricket::SessionDescription* desc2, |
634 bool expect_equal) { | 633 bool expect_equal) { |
635 if (desc1->contents().size() != desc2->contents().size()) { | 634 if (desc1->contents().size() != desc2->contents().size()) { |
636 EXPECT_FALSE(expect_equal); | 635 EXPECT_FALSE(expect_equal); |
637 return; | 636 return; |
(...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3719 mediastream_signaling_.SendAudioVideoStream1(); | 3718 mediastream_signaling_.SendAudioVideoStream1(); |
3720 SessionDescriptionInterface* offer = CreateOffer(); | 3719 SessionDescriptionInterface* offer = CreateOffer(); |
3721 | 3720 |
3722 SetLocalDescriptionWithoutError(offer); | 3721 SetLocalDescriptionWithoutError(offer); |
3723 | 3722 |
3724 video_channel_ = media_engine_->GetVideoChannel(0); | 3723 video_channel_ = media_engine_->GetVideoChannel(0); |
3725 voice_channel_ = media_engine_->GetVoiceChannel(0); | 3724 voice_channel_ = media_engine_->GetVoiceChannel(0); |
3726 | 3725 |
3727 ASSERT_TRUE(video_channel_ != NULL); | 3726 ASSERT_TRUE(video_channel_ != NULL); |
3728 ASSERT_TRUE(voice_channel_ != NULL); | 3727 ASSERT_TRUE(voice_channel_ != NULL); |
3729 cricket::AudioOptions audio_options; | 3728 const cricket::AudioOptions& audio_options = voice_channel_->options(); |
3730 EXPECT_TRUE(voice_channel_->GetOptions(&audio_options)); | 3729 const cricket::VideoOptions& video_options = video_channel_->options(); |
3731 cricket::VideoOptions video_options; | |
3732 EXPECT_TRUE(video_channel_->GetOptions(&video_options)); | |
3733 EXPECT_TRUE(audio_options.dscp.IsSet()); | 3730 EXPECT_TRUE(audio_options.dscp.IsSet()); |
3734 EXPECT_TRUE(audio_options.dscp.GetWithDefaultIfUnset(false)); | 3731 EXPECT_TRUE(audio_options.dscp.GetWithDefaultIfUnset(false)); |
3735 EXPECT_TRUE(video_options.dscp.IsSet()); | 3732 EXPECT_TRUE(video_options.dscp.IsSet()); |
3736 EXPECT_TRUE(video_options.dscp.GetWithDefaultIfUnset(false)); | 3733 EXPECT_TRUE(video_options.dscp.GetWithDefaultIfUnset(false)); |
3737 } | 3734 } |
3738 | 3735 |
3739 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { | 3736 TEST_F(WebRtcSessionTest, TestSuspendBelowMinBitrateConstraint) { |
3740 constraints_.reset(new FakeConstraints()); | 3737 constraints_.reset(new FakeConstraints()); |
3741 constraints_->AddOptional( | 3738 constraints_->AddOptional( |
3742 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, | 3739 webrtc::MediaConstraintsInterface::kEnableVideoSuspendBelowMinBitrate, |
3743 true); | 3740 true); |
3744 Init(); | 3741 Init(); |
3745 mediastream_signaling_.SendAudioVideoStream1(); | 3742 mediastream_signaling_.SendAudioVideoStream1(); |
3746 SessionDescriptionInterface* offer = CreateOffer(); | 3743 SessionDescriptionInterface* offer = CreateOffer(); |
3747 | 3744 |
3748 SetLocalDescriptionWithoutError(offer); | 3745 SetLocalDescriptionWithoutError(offer); |
3749 | 3746 |
3750 video_channel_ = media_engine_->GetVideoChannel(0); | 3747 video_channel_ = media_engine_->GetVideoChannel(0); |
3751 | 3748 |
3752 ASSERT_TRUE(video_channel_ != NULL); | 3749 ASSERT_TRUE(video_channel_ != NULL); |
3753 cricket::VideoOptions video_options; | 3750 const cricket::VideoOptions& video_options = video_channel_->options(); |
3754 EXPECT_TRUE(video_channel_->GetOptions(&video_options)); | |
3755 EXPECT_TRUE( | 3751 EXPECT_TRUE( |
3756 video_options.suspend_below_min_bitrate.GetWithDefaultIfUnset(false)); | 3752 video_options.suspend_below_min_bitrate.GetWithDefaultIfUnset(false)); |
3757 } | 3753 } |
3758 | 3754 |
3759 TEST_F(WebRtcSessionTest, TestNumUnsignalledRecvStreamsConstraint) { | 3755 TEST_F(WebRtcSessionTest, TestNumUnsignalledRecvStreamsConstraint) { |
3760 // Number of unsignalled receiving streams should be between 0 and | 3756 // Number of unsignalled receiving streams should be between 0 and |
3761 // kMaxUnsignalledRecvStreams. | 3757 // kMaxUnsignalledRecvStreams. |
3762 SetAndVerifyNumUnsignalledRecvStreams(10, 10); | 3758 SetAndVerifyNumUnsignalledRecvStreams(10, 10); |
3763 SetAndVerifyNumUnsignalledRecvStreams(kMaxUnsignalledRecvStreams + 1, | 3759 SetAndVerifyNumUnsignalledRecvStreams(kMaxUnsignalledRecvStreams + 1, |
3764 kMaxUnsignalledRecvStreams); | 3760 kMaxUnsignalledRecvStreams); |
3765 SetAndVerifyNumUnsignalledRecvStreams(-1, 0); | 3761 SetAndVerifyNumUnsignalledRecvStreams(-1, 0); |
3766 } | 3762 } |
3767 | 3763 |
3768 TEST_F(WebRtcSessionTest, TestCombinedAudioVideoBweConstraint) { | 3764 TEST_F(WebRtcSessionTest, TestCombinedAudioVideoBweConstraint) { |
3769 constraints_.reset(new FakeConstraints()); | 3765 constraints_.reset(new FakeConstraints()); |
3770 constraints_->AddOptional( | 3766 constraints_->AddOptional( |
3771 webrtc::MediaConstraintsInterface::kCombinedAudioVideoBwe, | 3767 webrtc::MediaConstraintsInterface::kCombinedAudioVideoBwe, |
3772 true); | 3768 true); |
3773 Init(); | 3769 Init(); |
3774 mediastream_signaling_.SendAudioVideoStream1(); | 3770 mediastream_signaling_.SendAudioVideoStream1(); |
3775 SessionDescriptionInterface* offer = CreateOffer(); | 3771 SessionDescriptionInterface* offer = CreateOffer(); |
3776 | 3772 |
3777 SetLocalDescriptionWithoutError(offer); | 3773 SetLocalDescriptionWithoutError(offer); |
3778 | 3774 |
3779 voice_channel_ = media_engine_->GetVoiceChannel(0); | 3775 voice_channel_ = media_engine_->GetVoiceChannel(0); |
3780 | 3776 |
3781 ASSERT_TRUE(voice_channel_ != NULL); | 3777 ASSERT_TRUE(voice_channel_ != NULL); |
3782 cricket::AudioOptions audio_options; | 3778 const cricket::AudioOptions& audio_options = voice_channel_->options(); |
3783 EXPECT_TRUE(voice_channel_->GetOptions(&audio_options)); | |
3784 EXPECT_TRUE( | 3779 EXPECT_TRUE( |
3785 audio_options.combined_audio_video_bwe.GetWithDefaultIfUnset(false)); | 3780 audio_options.combined_audio_video_bwe.GetWithDefaultIfUnset(false)); |
3786 } | 3781 } |
3787 | 3782 |
3788 // Tests that we can renegotiate new media content with ICE candidates in the | 3783 // Tests that we can renegotiate new media content with ICE candidates in the |
3789 // new remote SDP. | 3784 // new remote SDP. |
3790 TEST_P(WebRtcSessionTest, TestRenegotiateNewMediaWithCandidatesInSdp) { | 3785 TEST_P(WebRtcSessionTest, TestRenegotiateNewMediaWithCandidatesInSdp) { |
3791 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 3786 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
3792 InitWithDtls(GetParam()); | 3787 InitWithDtls(GetParam()); |
3793 SetFactoryDtlsSrtp(); | 3788 SetFactoryDtlsSrtp(); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3942 } | 3937 } |
3943 } | 3938 } |
3944 | 3939 |
3945 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 3940 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
3946 // currently fails because upon disconnection and reconnection OnIceComplete is | 3941 // currently fails because upon disconnection and reconnection OnIceComplete is |
3947 // called more than once without returning to IceGatheringGathering. | 3942 // called more than once without returning to IceGatheringGathering. |
3948 | 3943 |
3949 INSTANTIATE_TEST_CASE_P( | 3944 INSTANTIATE_TEST_CASE_P( |
3950 WebRtcSessionTests, WebRtcSessionTest, | 3945 WebRtcSessionTests, WebRtcSessionTest, |
3951 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE)); | 3946 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE)); |
OLD | NEW |