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

Side by Side Diff: webrtc/p2p/base/transportdescriptionfactory_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/p2p/base/transportdescriptionfactory.cc ('k') | webrtc/pc/mediasession_unittest.cc » ('j') | 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 std::unique_ptr<TransportDescription> renomination_answer(f2_.CreateAnswer( 120 std::unique_ptr<TransportDescription> renomination_answer(f2_.CreateAnswer(
121 renomination_offer.get(), options, true, answer.get())); 121 renomination_offer.get(), options, true, answer.get()));
122 VerifyRenomination(renomination_answer.get(), true); 122 VerifyRenomination(renomination_answer.get(), true);
123 } 123 }
124 124
125 protected: 125 protected:
126 void VerifyRenomination(TransportDescription* desc, 126 void VerifyRenomination(TransportDescription* desc,
127 bool renomination_expected) { 127 bool renomination_expected) {
128 ASSERT_TRUE(desc != nullptr); 128 ASSERT_TRUE(desc != nullptr);
129 std::vector<std::string>& options = desc->transport_options; 129 std::vector<std::string>& options = desc->transport_options;
130 auto iter = std::find(options.begin(), options.end(), 130 auto iter = std::find(options.begin(), options.end(), "renomination");
131 cricket::ICE_RENOMINATION_STR);
132 EXPECT_EQ(renomination_expected, iter != options.end()); 131 EXPECT_EQ(renomination_expected, iter != options.end());
133 } 132 }
134 133
135 void SetDtls(bool dtls) { 134 void SetDtls(bool dtls) {
136 if (dtls) { 135 if (dtls) {
137 f1_.set_secure(cricket::SEC_ENABLED); 136 f1_.set_secure(cricket::SEC_ENABLED);
138 f2_.set_secure(cricket::SEC_ENABLED); 137 f2_.set_secure(cricket::SEC_ENABLED);
139 f1_.set_certificate(cert1_); 138 f1_.set_certificate(cert1_);
140 f2_.set_certificate(cert2_); 139 f2_.set_certificate(cert2_);
141 } else { 140 } else {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 TEST_F(TransportDescriptionFactoryTest, TestIceRenomination) { 292 TEST_F(TransportDescriptionFactoryTest, TestIceRenomination) {
294 TestIceRenomination(false); 293 TestIceRenomination(false);
295 } 294 }
296 295
297 // Test that ice renomination is set in an updated offer and answer 296 // Test that ice renomination is set in an updated offer and answer
298 // if |TransportDescriptionOptions::enable_ice_renomination| is true and DTLS 297 // if |TransportDescriptionOptions::enable_ice_renomination| is true and DTLS
299 // is enabled. 298 // is enabled.
300 TEST_F(TransportDescriptionFactoryTest, TestIceRenominationWithDtls) { 299 TEST_F(TransportDescriptionFactoryTest, TestIceRenominationWithDtls) {
301 TestIceRenomination(true); 300 TestIceRenomination(true);
302 } 301 }
302
303 // Test that offers and answers have ice-option:trickle.
304 TEST_F(TransportDescriptionFactoryTest, AddsTrickleIceOption) {
305 cricket::TransportOptions options;
306 std::unique_ptr<TransportDescription> offer(
307 f1_.CreateOffer(options, nullptr));
308 EXPECT_TRUE(offer->HasOption("trickle"));
309 std::unique_ptr<TransportDescription> answer(
310 f2_.CreateAnswer(offer.get(), options, true, nullptr));
311 EXPECT_TRUE(answer->HasOption("trickle"));
312 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transportdescriptionfactory.cc ('k') | webrtc/pc/mediasession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698