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

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

Issue 2970883005: Handle case where UDP packet contains multiple DTLS records. (Closed)
Patch Set: Feedback from Taylor. 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
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/fakeicetransport.h » ('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 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.
674 // Our DTLS implementation doesn't do this, but other implementations may;
675 // see https://tools.ietf.org/html/rfc6347#section-4.1.1.
676 // This has caused interoperability problems with ORTCLib in the past.
677 TEST_F(DtlsTransportChannelTest, TestTransferDtlsCombineRecords) {
678 PrepareDtls(true, true, rtc::KT_DEFAULT);
679 ASSERT_TRUE(Connect());
680 // Our DTLS implementation always sends one record per packet, so to simulate
681 // an endpoint that sends multiple records per packet, we configure the fake
682 // ICE transport to combine every two consecutive packets into a single
683 // packet.
684 cricket::FakeIceTransport* transport = client1_.GetFakeIceTransort(0);
685 transport->combine_outgoing_packets(true);
686 TestTransfer(0, 500, 100, false);
687 }
688
673 // Connect with A doing DTLS and B not, and transfer some data. 689 // Connect with A doing DTLS and B not, and transfer some data.
674 TEST_F(DtlsTransportChannelTest, TestTransferDtlsRejected) { 690 TEST_F(DtlsTransportChannelTest, TestTransferDtlsRejected) {
675 PrepareDtls(true, false, rtc::KT_DEFAULT); 691 PrepareDtls(true, false, rtc::KT_DEFAULT);
676 ASSERT_TRUE(Connect()); 692 ASSERT_TRUE(Connect());
677 TestTransfer(0, 1000, 100, false); 693 TestTransfer(0, 1000, 100, false);
678 } 694 }
679 695
680 // Connect with B doing DTLS and A not, and transfer some data. 696 // Connect with B doing DTLS and A not, and transfer some data.
681 TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) { 697 TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) {
682 PrepareDtls(false, true, rtc::KT_DEFAULT); 698 PrepareDtls(false, true, rtc::KT_DEFAULT);
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 std::vector<DtlsTransportEvent>{ 1125 std::vector<DtlsTransportEvent>{
1110 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT, 1126 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT,
1111 CALLER_WRITABLE, HANDSHAKE_FINISHES}, 1127 CALLER_WRITABLE, HANDSHAKE_FINISHES},
1112 std::vector<DtlsTransportEvent>{ 1128 std::vector<DtlsTransportEvent>{
1113 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE, 1129 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE,
1114 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES}, 1130 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES},
1115 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO, 1131 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO,
1116 CALLER_WRITABLE, HANDSHAKE_FINISHES, 1132 CALLER_WRITABLE, HANDSHAKE_FINISHES,
1117 CALLER_RECEIVES_FINGERPRINT}), 1133 CALLER_RECEIVES_FINGERPRINT}),
1118 ::testing::Bool())); 1134 ::testing::Bool()));
OLDNEW
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.cc ('k') | webrtc/p2p/base/fakeicetransport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698