| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 static const int kFakePacketId = 0x1234; | 35 static const int kFakePacketId = 0x1234; |
| 36 static const int kTimeout = 10000; | 36 static const int kTimeout = 10000; |
| 37 | 37 |
| 38 static bool IsRtpLeadByte(uint8_t b) { | 38 static bool IsRtpLeadByte(uint8_t b) { |
| 39 return ((b & 0xC0) == 0x80); | 39 return ((b & 0xC0) == 0x80); |
| 40 } | 40 } |
| 41 | 41 |
| 42 cricket::TransportDescription MakeTransportDescription( | 42 cricket::TransportDescription MakeTransportDescription( |
| 43 const rtc::scoped_refptr<rtc::RTCCertificate>& cert, | 43 const rtc::scoped_refptr<rtc::RTCCertificate>& cert, |
| 44 cricket::ConnectionRole role) { | 44 cricket::ConnectionRole role) { |
| 45 rtc::scoped_ptr<rtc::SSLFingerprint> fingerprint; | 45 std::unique_ptr<rtc::SSLFingerprint> fingerprint; |
| 46 if (cert) { | 46 if (cert) { |
| 47 std::string digest_algorithm; | 47 std::string digest_algorithm; |
| 48 cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm); | 48 cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm); |
| 49 fingerprint.reset( | 49 fingerprint.reset( |
| 50 rtc::SSLFingerprint::Create(digest_algorithm, cert->identity())); | 50 rtc::SSLFingerprint::Create(digest_algorithm, cert->identity())); |
| 51 } | 51 } |
| 52 return cricket::TransportDescription(std::vector<std::string>(), kIceUfrag1, | 52 return cricket::TransportDescription(std::vector<std::string>(), kIceUfrag1, |
| 53 kIcePwd1, cricket::ICEMODE_FULL, role, | 53 kIcePwd1, cricket::ICEMODE_FULL, role, |
| 54 fingerprint.get()); | 54 fingerprint.get()); |
| 55 } | 55 } |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 client1_.transport()->SetRemoteTransportDescription( | 967 client1_.transport()->SetRemoteTransportDescription( |
| 968 MakeTransportDescription(client2_.certificate(), | 968 MakeTransportDescription(client2_.certificate(), |
| 969 cricket::CONNECTIONROLE_ACTIVE), | 969 cricket::CONNECTIONROLE_ACTIVE), |
| 970 cricket::CA_ANSWER, nullptr); | 970 cricket::CA_ANSWER, nullptr); |
| 971 EXPECT_TRUE(client1_.Connect(&client2_, true)); | 971 EXPECT_TRUE(client1_.Connect(&client2_, true)); |
| 972 EXPECT_TRUE_WAIT( | 972 EXPECT_TRUE_WAIT( |
| 973 client1_.all_channels_writable() && client2_.all_channels_writable(), | 973 client1_.all_channels_writable() && client2_.all_channels_writable(), |
| 974 kTimeout); | 974 kTimeout); |
| 975 EXPECT_EQ(1, client1_.received_dtls_client_hellos()); | 975 EXPECT_EQ(1, client1_.received_dtls_client_hellos()); |
| 976 } | 976 } |
| OLD | NEW |