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

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

Issue 2254003002: Fixing off-by-one error with max SCTP id. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removing unneeded parentheses. Created 4 years, 4 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
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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 rtc::scoped_refptr<DataChannelInterface> channel; 1820 rtc::scoped_refptr<DataChannelInterface> channel;
1821 1821
1822 config.id = 1; 1822 config.id = 1;
1823 channel = pc_->CreateDataChannel("1", &config); 1823 channel = pc_->CreateDataChannel("1", &config);
1824 EXPECT_TRUE(channel != NULL); 1824 EXPECT_TRUE(channel != NULL);
1825 EXPECT_EQ(1, channel->id()); 1825 EXPECT_EQ(1, channel->id());
1826 1826
1827 channel = pc_->CreateDataChannel("x", &config); 1827 channel = pc_->CreateDataChannel("x", &config);
1828 EXPECT_TRUE(channel == NULL); 1828 EXPECT_TRUE(channel == NULL);
1829 1829
1830 config.id = cricket::kMaxSctpSid; 1830 config.id = cricket::kMaxSctpStreams - 1;
1831 channel = pc_->CreateDataChannel("max", &config); 1831 channel = pc_->CreateDataChannel("max", &config);
1832 EXPECT_TRUE(channel != NULL); 1832 EXPECT_TRUE(channel != NULL);
1833 EXPECT_EQ(config.id, channel->id()); 1833 EXPECT_EQ(config.id, channel->id());
1834 1834
1835 config.id = cricket::kMaxSctpSid + 1; 1835 config.id = cricket::kMaxSctpStreams;
1836 channel = pc_->CreateDataChannel("x", &config); 1836 channel = pc_->CreateDataChannel("x", &config);
1837 EXPECT_TRUE(channel == NULL); 1837 EXPECT_TRUE(channel == NULL);
1838 } 1838 }
1839 1839
1840 // Verifies that duplicated label is allowed for SCTP data channel. 1840 // Verifies that duplicated label is allowed for SCTP data channel.
1841 TEST_F(PeerConnectionInterfaceTest, SctpDuplicatedLabelAllowed) { 1841 TEST_F(PeerConnectionInterfaceTest, SctpDuplicatedLabelAllowed) {
1842 FakeConstraints constraints; 1842 FakeConstraints constraints;
1843 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, 1843 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
1844 true); 1844 true);
1845 CreatePeerConnection(&constraints); 1845 CreatePeerConnection(&constraints);
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 FakeConstraints updated_answer_c; 2888 FakeConstraints updated_answer_c;
2889 answer_c.SetMandatoryReceiveAudio(false); 2889 answer_c.SetMandatoryReceiveAudio(false);
2890 answer_c.SetMandatoryReceiveVideo(false); 2890 answer_c.SetMandatoryReceiveVideo(false);
2891 2891
2892 cricket::MediaSessionOptions updated_answer_options; 2892 cricket::MediaSessionOptions updated_answer_options;
2893 EXPECT_TRUE( 2893 EXPECT_TRUE(
2894 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2894 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2895 EXPECT_TRUE(updated_answer_options.has_audio()); 2895 EXPECT_TRUE(updated_answer_options.has_audio());
2896 EXPECT_TRUE(updated_answer_options.has_video()); 2896 EXPECT_TRUE(updated_answer_options.has_video());
2897 } 2897 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698