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 3684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3695 EXPECT_NE(a, f); | 3695 EXPECT_NE(a, f); |
3696 | 3696 |
3697 PeerConnectionInterface::RTCConfiguration g; | 3697 PeerConnectionInterface::RTCConfiguration g; |
3698 g.disable_ipv6 = true; | 3698 g.disable_ipv6 = true; |
3699 EXPECT_NE(a, g); | 3699 EXPECT_NE(a, g); |
3700 | 3700 |
3701 PeerConnectionInterface::RTCConfiguration h( | 3701 PeerConnectionInterface::RTCConfiguration h( |
3702 PeerConnectionInterface::RTCConfigurationType::kAggressive); | 3702 PeerConnectionInterface::RTCConfigurationType::kAggressive); |
3703 EXPECT_NE(a, h); | 3703 EXPECT_NE(a, h); |
3704 } | 3704 } |
| 3705 |
| 3706 // This test ensures OnRenegotiationNeeded is called when we add track with |
| 3707 // MediaStream -> AddTrack in the same way it is called when we add track with |
| 3708 // PeerConnection -> AddTrack. |
| 3709 // The test can be removed once addStream is rewritten in terms of addTrack |
| 3710 // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 |
| 3711 TEST_F(PeerConnectionInterfaceTest, MediaStreamAddTrackRemoveTrackRenegotiate) { |
| 3712 CreatePeerConnectionWithoutDtls(); |
| 3713 rtc::scoped_refptr<MediaStreamInterface> stream( |
| 3714 pc_factory_->CreateLocalMediaStream(kStreamLabel1)); |
| 3715 pc_->AddStream(stream); |
| 3716 rtc::scoped_refptr<AudioTrackInterface> audio_track( |
| 3717 pc_factory_->CreateAudioTrack("audio_track", nullptr)); |
| 3718 rtc::scoped_refptr<VideoTrackInterface> video_track( |
| 3719 pc_factory_->CreateVideoTrack( |
| 3720 "video_track", pc_factory_->CreateVideoSource( |
| 3721 std::unique_ptr<cricket::VideoCapturer>( |
| 3722 new cricket::FakeVideoCapturer())))); |
| 3723 stream->AddTrack(audio_track); |
| 3724 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); |
| 3725 observer_.renegotiation_needed_ = false; |
| 3726 |
| 3727 stream->AddTrack(video_track); |
| 3728 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); |
| 3729 observer_.renegotiation_needed_ = false; |
| 3730 |
| 3731 stream->RemoveTrack(audio_track); |
| 3732 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); |
| 3733 observer_.renegotiation_needed_ = false; |
| 3734 |
| 3735 stream->RemoveTrack(video_track); |
| 3736 EXPECT_TRUE_WAIT(observer_.renegotiation_needed_, kTimeout); |
| 3737 observer_.renegotiation_needed_ = false; |
| 3738 } |
OLD | NEW |