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

Side by Side Diff: webrtc/p2p/base/dtlstransportchannel_unittest.cc

Issue 2970883005: Handle case where UDP packet contains multiple DTLS records. (Closed)
Patch Set: Created 3 years, 5 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 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 663
664 // Create two channels with DTLS, and transfer some data. 664 // Create two channels with DTLS, and transfer some data.
665 TEST_F(DtlsTransportChannelTest, TestTransferDtlsTwoChannels) { 665 TEST_F(DtlsTransportChannelTest, TestTransferDtlsTwoChannels) {
666 SetChannelCount(2); 666 SetChannelCount(2);
667 PrepareDtls(true, true, rtc::KT_DEFAULT); 667 PrepareDtls(true, true, rtc::KT_DEFAULT);
668 ASSERT_TRUE(Connect()); 668 ASSERT_TRUE(Connect());
669 TestTransfer(0, 1000, 100, false); 669 TestTransfer(0, 1000, 100, false);
670 TestTransfer(1, 1000, 100, false); 670 TestTransfer(1, 1000, 100, false);
671 } 671 }
672 672
673 // Connect with DTLS, combine multiple DTLS records into one packet.
Taylor Brandstetter 2017/07/06 22:06:11 May be nice to have some context here; "Our DTLS i
joachim 2017/07/07 16:12:59 Done
674 TEST_F(DtlsTransportChannelTest, TestTransferDtlsCombineRecords) {
675 PrepareDtls(true, true, rtc::KT_DEFAULT);
676 ASSERT_TRUE(Connect());
677 cricket::FakeIceTransport* transport = client1_.GetFakeIceTransort(0);
678 transport->set_combine(true);
Taylor Brandstetter 2017/07/06 22:06:11 Would be nice to have a comment saying something l
joachim 2017/07/07 16:12:59 Done.
679 TestTransfer(0, 500, 100, false);
680 }
681
673 // Connect with A doing DTLS and B not, and transfer some data. 682 // Connect with A doing DTLS and B not, and transfer some data.
674 TEST_F(DtlsTransportChannelTest, TestTransferDtlsRejected) { 683 TEST_F(DtlsTransportChannelTest, TestTransferDtlsRejected) {
675 PrepareDtls(true, false, rtc::KT_DEFAULT); 684 PrepareDtls(true, false, rtc::KT_DEFAULT);
676 ASSERT_TRUE(Connect()); 685 ASSERT_TRUE(Connect());
677 TestTransfer(0, 1000, 100, false); 686 TestTransfer(0, 1000, 100, false);
678 } 687 }
679 688
680 // Connect with B doing DTLS and A not, and transfer some data. 689 // Connect with B doing DTLS and A not, and transfer some data.
681 TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) { 690 TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) {
682 PrepareDtls(false, true, rtc::KT_DEFAULT); 691 PrepareDtls(false, true, rtc::KT_DEFAULT);
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 std::vector<DtlsTransportEvent>{ 1118 std::vector<DtlsTransportEvent>{
1110 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT, 1119 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT,
1111 CALLER_WRITABLE, HANDSHAKE_FINISHES}, 1120 CALLER_WRITABLE, HANDSHAKE_FINISHES},
1112 std::vector<DtlsTransportEvent>{ 1121 std::vector<DtlsTransportEvent>{
1113 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE, 1122 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE,
1114 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES}, 1123 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES},
1115 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO, 1124 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO,
1116 CALLER_WRITABLE, HANDSHAKE_FINISHES, 1125 CALLER_WRITABLE, HANDSHAKE_FINISHES,
1117 CALLER_RECEIVES_FINGERPRINT}), 1126 CALLER_RECEIVES_FINGERPRINT}),
1118 ::testing::Bool())); 1127 ::testing::Bool()));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698