| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 const std::string& transport_name, | 618 const std::string& transport_name, |
| 619 int component) { | 619 int component) { |
| 620 return static_cast<FakeTransportChannel*>( | 620 return static_cast<FakeTransportChannel*>( |
| 621 get_channel_for_testing(transport_name, component)); | 621 get_channel_for_testing(transport_name, component)); |
| 622 } | 622 } |
| 623 | 623 |
| 624 // Simulate the exchange of transport descriptions, and the gathering and | 624 // Simulate the exchange of transport descriptions, and the gathering and |
| 625 // exchange of ICE candidates. | 625 // exchange of ICE candidates. |
| 626 void Connect(FakeTransportController* dest) { | 626 void Connect(FakeTransportController* dest) { |
| 627 for (const std::string& transport_name : transport_names_for_testing()) { | 627 for (const std::string& transport_name : transport_names_for_testing()) { |
| 628 std::unique_ptr<rtc::SSLFingerprint> local_fingerprint; |
| 629 std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint; |
| 630 if (certificate_for_testing()) { |
| 631 local_fingerprint.reset(rtc::SSLFingerprint::CreateFromCertificate( |
| 632 certificate_for_testing())); |
| 633 } |
| 634 if (dest->certificate_for_testing()) { |
| 635 remote_fingerprint.reset(rtc::SSLFingerprint::CreateFromCertificate( |
| 636 dest->certificate_for_testing())); |
| 637 } |
| 628 TransportDescription local_desc( | 638 TransportDescription local_desc( |
| 629 std::vector<std::string>(), | 639 std::vector<std::string>(), |
| 630 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), | 640 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), |
| 631 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), | 641 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), |
| 632 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, nullptr); | 642 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, |
| 643 local_fingerprint.get()); |
| 633 TransportDescription remote_desc( | 644 TransportDescription remote_desc( |
| 634 std::vector<std::string>(), | 645 std::vector<std::string>(), |
| 635 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), | 646 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), |
| 636 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), | 647 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), |
| 637 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, nullptr); | 648 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, |
| 649 remote_fingerprint.get()); |
| 638 std::string err; | 650 std::string err; |
| 639 SetLocalTransportDescription(transport_name, local_desc, | 651 SetLocalTransportDescription(transport_name, local_desc, |
| 640 cricket::CA_OFFER, &err); | 652 cricket::CA_OFFER, &err); |
| 641 dest->SetRemoteTransportDescription(transport_name, local_desc, | 653 dest->SetRemoteTransportDescription(transport_name, local_desc, |
| 642 cricket::CA_OFFER, &err); | 654 cricket::CA_OFFER, &err); |
| 643 dest->SetLocalTransportDescription(transport_name, remote_desc, | 655 dest->SetLocalTransportDescription(transport_name, remote_desc, |
| 644 cricket::CA_ANSWER, &err); | 656 cricket::CA_ANSWER, &err); |
| 645 SetRemoteTransportDescription(transport_name, remote_desc, | 657 SetRemoteTransportDescription(transport_name, remote_desc, |
| 646 cricket::CA_ANSWER, &err); | 658 cricket::CA_ANSWER, &err); |
| 647 } | 659 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 bool asymmetric = false; | 709 bool asymmetric = false; |
| 698 local->SetDestination(remote, asymmetric); | 710 local->SetDestination(remote, asymmetric); |
| 699 } | 711 } |
| 700 } | 712 } |
| 701 } | 713 } |
| 702 }; | 714 }; |
| 703 | 715 |
| 704 } // namespace cricket | 716 } // namespace cricket |
| 705 | 717 |
| 706 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 718 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
| OLD | NEW |