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

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

Issue 2770903003: Accept remote offers with current DTLS role, rather than "actpass". (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | webrtc/p2p/base/jseptransport.h » ('j') | webrtc/p2p/base/jseptransport.cc » ('J')
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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 cricket::CONNECTIONROLE_PASSIVE)); 811 cricket::CONNECTIONROLE_PASSIVE));
812 TestTransfer(0, 1000, 100, true); 812 TestTransfer(0, 1000, 100, true);
813 TestTransfer(1, 1000, 100, true); 813 TestTransfer(1, 1000, 100, true);
814 } 814 }
815 815
816 // Testing with the legacy DTLS client which doesn't use setup attribute. 816 // Testing with the legacy DTLS client which doesn't use setup attribute.
817 // In this case legacy is the answerer. 817 // In this case legacy is the answerer.
818 TEST_F(DtlsTransportChannelTest, TestDtlsSetupWithLegacyAsAnswerer) { 818 TEST_F(DtlsTransportChannelTest, TestDtlsSetupWithLegacyAsAnswerer) {
819 PrepareDtls(true, true, rtc::KT_DEFAULT); 819 PrepareDtls(true, true, rtc::KT_DEFAULT);
820 NegotiateWithLegacy(); 820 NegotiateWithLegacy();
821 rtc::SSLRole channel1_role; 821 EXPECT_EQ(rtc::SSL_SERVER, *client1_.transport()->GetSslRole());
822 rtc::SSLRole channel2_role; 822 EXPECT_EQ(rtc::SSL_CLIENT, *client2_.transport()->GetSslRole());
823 client1_.transport()->GetSslRole(&channel1_role);
824 client2_.transport()->GetSslRole(&channel2_role);
825 EXPECT_EQ(rtc::SSL_SERVER, channel1_role);
826 EXPECT_EQ(rtc::SSL_CLIENT, channel2_role);
827 } 823 }
828 824
829 // Testing re offer/answer after the session is estbalished. Roles will be 825 // Testing re offer/answer after the session is estbalished. Roles will be
830 // kept same as of the previous negotiation. 826 // kept same as of the previous negotiation.
831 TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromOfferer) { 827 TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromOfferer) {
832 SetChannelCount(2); 828 SetChannelCount(2);
833 PrepareDtls(true, true, rtc::KT_DEFAULT); 829 PrepareDtls(true, true, rtc::KT_DEFAULT);
834 PrepareDtlsSrtp(true, true); 830 PrepareDtlsSrtp(true, true);
835 // Initial role for client1 is ACTPASS and client2 is ACTIVE. 831 // Initial role for client1 is ACTPASS and client2 is ACTIVE.
836 ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS, 832 ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 std::vector<DtlsTransportEvent>{ 1156 std::vector<DtlsTransportEvent>{
1161 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT, 1157 CALLER_RECEIVES_CLIENTHELLO, CALLER_RECEIVES_FINGERPRINT,
1162 CALLER_WRITABLE, HANDSHAKE_FINISHES}, 1158 CALLER_WRITABLE, HANDSHAKE_FINISHES},
1163 std::vector<DtlsTransportEvent>{ 1159 std::vector<DtlsTransportEvent>{
1164 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE, 1160 CALLER_RECEIVES_CLIENTHELLO, CALLER_WRITABLE,
1165 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES}, 1161 CALLER_RECEIVES_FINGERPRINT, HANDSHAKE_FINISHES},
1166 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO, 1162 std::vector<DtlsTransportEvent>{CALLER_RECEIVES_CLIENTHELLO,
1167 CALLER_WRITABLE, HANDSHAKE_FINISHES, 1163 CALLER_WRITABLE, HANDSHAKE_FINISHES,
1168 CALLER_RECEIVES_FINGERPRINT}), 1164 CALLER_RECEIVES_FINGERPRINT}),
1169 ::testing::Bool())); 1165 ::testing::Bool()));
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/jseptransport.h » ('j') | webrtc/p2p/base/jseptransport.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698