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

Side by Side Diff: webrtc/pc/peerconnectioninterface_unittest.cc

Issue 2808913003: Add "ice-option:trickle" to generated offers/answers. (Closed)
Patch Set: Merge with master Created 3 years, 8 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/pc/peerconnection_integrationtest.cc ('k') | no next file » | 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 3147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3158 CreatePeerConnection(); 3158 CreatePeerConnection();
3159 // The RtcEventLog will be reset when the PeerConnection is closed. 3159 // The RtcEventLog will be reset when the PeerConnection is closed.
3160 pc_->Close(); 3160 pc_->Close();
3161 3161
3162 rtc::PlatformFile file = 0; 3162 rtc::PlatformFile file = 0;
3163 int64_t max_size_bytes = 1024; 3163 int64_t max_size_bytes = 1024;
3164 EXPECT_FALSE(pc_->StartRtcEventLog(file, max_size_bytes)); 3164 EXPECT_FALSE(pc_->StartRtcEventLog(file, max_size_bytes));
3165 pc_->StopRtcEventLog(); 3165 pc_->StopRtcEventLog();
3166 } 3166 }
3167 3167
3168 // Test that generated offers/answers include "ice-option:trickle".
3169 TEST_F(PeerConnectionInterfaceTest, OffersAndAnswersHaveTrickleIceOption) {
3170 CreatePeerConnection();
3171
3172 // First, create an offer with audio/video.
3173 FakeConstraints constraints;
3174 constraints.SetMandatoryReceiveAudio(true);
3175 constraints.SetMandatoryReceiveVideo(true);
3176 std::unique_ptr<SessionDescriptionInterface> offer;
3177 ASSERT_TRUE(DoCreateOffer(&offer, &constraints));
3178 cricket::SessionDescription* desc = offer->description();
3179 ASSERT_EQ(2u, desc->transport_infos().size());
3180 EXPECT_TRUE(desc->transport_infos()[0].description.HasOption("trickle"));
3181 EXPECT_TRUE(desc->transport_infos()[1].description.HasOption("trickle"));
3182
3183 // Apply the offer as a remote description, then create an answer.
3184 EXPECT_TRUE(DoSetRemoteDescription(offer.release()));
3185 std::unique_ptr<SessionDescriptionInterface> answer;
3186 ASSERT_TRUE(DoCreateAnswer(&answer, &constraints));
3187 desc = answer->description();
3188 ASSERT_EQ(2u, desc->transport_infos().size());
3189 EXPECT_TRUE(desc->transport_infos()[0].description.HasOption("trickle"));
3190 EXPECT_TRUE(desc->transport_infos()[1].description.HasOption("trickle"));
3191 }
3192
3168 // Test that ICE renomination isn't offered if it's not enabled in the PC's 3193 // Test that ICE renomination isn't offered if it's not enabled in the PC's
3169 // RTCConfiguration. 3194 // RTCConfiguration.
3170 TEST_F(PeerConnectionInterfaceTest, IceRenominationNotOffered) { 3195 TEST_F(PeerConnectionInterfaceTest, IceRenominationNotOffered) {
3171 PeerConnectionInterface::RTCConfiguration config; 3196 PeerConnectionInterface::RTCConfiguration config;
3172 config.enable_ice_renomination = false; 3197 config.enable_ice_renomination = false;
3173 CreatePeerConnection(config, nullptr); 3198 CreatePeerConnection(config, nullptr);
3174 AddVoiceStream("foo"); 3199 AddVoiceStream("foo");
3175 3200
3176 std::unique_ptr<SessionDescriptionInterface> offer; 3201 std::unique_ptr<SessionDescriptionInterface> offer;
3177 ASSERT_TRUE(DoCreateOffer(&offer, nullptr)); 3202 ASSERT_TRUE(DoCreateOffer(&offer, nullptr));
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 EXPECT_NE(a, f); 3599 EXPECT_NE(a, f);
3575 3600
3576 PeerConnectionInterface::RTCConfiguration g; 3601 PeerConnectionInterface::RTCConfiguration g;
3577 g.disable_ipv6 = true; 3602 g.disable_ipv6 = true;
3578 EXPECT_NE(a, g); 3603 EXPECT_NE(a, g);
3579 3604
3580 PeerConnectionInterface::RTCConfiguration h( 3605 PeerConnectionInterface::RTCConfiguration h(
3581 PeerConnectionInterface::RTCConfigurationType::kAggressive); 3606 PeerConnectionInterface::RTCConfigurationType::kAggressive);
3582 EXPECT_NE(a, h); 3607 EXPECT_NE(a, h);
3583 } 3608 }
OLDNEW
« no previous file with comments | « webrtc/pc/peerconnection_integrationtest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698