| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 // Simulate the exchange of candidates. | 547 // Simulate the exchange of candidates. |
| 548 ConnectChannels_w(); | 548 ConnectChannels_w(); |
| 549 dest->ConnectChannels_w(); | 549 dest->ConnectChannels_w(); |
| 550 for (auto& kv : transports()) { | 550 for (auto& kv : transports()) { |
| 551 FakeTransport* transport = static_cast<FakeTransport*>(kv.second); | 551 FakeTransport* transport = static_cast<FakeTransport*>(kv.second); |
| 552 transport->SetDestination(dest->GetTransport_w(kv.first)); | 552 transport->SetDestination(dest->GetTransport_w(kv.first)); |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 void ConnectChannels_w() { | 556 void ConnectChannels_w() { |
| 557 TransportDescription faketransport_desc( |
| 558 std::vector<std::string>(), |
| 559 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), |
| 560 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), cricket::ICEMODE_FULL, |
| 561 cricket::CONNECTIONROLE_NONE, nullptr); |
| 557 for (auto& kv : transports()) { | 562 for (auto& kv : transports()) { |
| 558 FakeTransport* transport = static_cast<FakeTransport*>(kv.second); | 563 FakeTransport* transport = static_cast<FakeTransport*>(kv.second); |
| 564 // Set local transport description for FakeTransport before connecting. |
| 565 // Otherwise, the RTC_CHECK in Transport.ConnectChannel will fail. |
| 566 if (!transport->local_description()) { |
| 567 transport->SetLocalTransportDescription(faketransport_desc, |
| 568 cricket::CA_OFFER, nullptr); |
| 569 } |
| 559 transport->ConnectChannels(); | 570 transport->ConnectChannels(); |
| 560 transport->MaybeStartGathering(); | 571 transport->MaybeStartGathering(); |
| 561 } | 572 } |
| 562 } | 573 } |
| 563 | 574 |
| 564 private: | 575 private: |
| 565 bool fail_create_channel_; | 576 bool fail_create_channel_; |
| 566 }; | 577 }; |
| 567 | 578 |
| 568 } // namespace cricket | 579 } // namespace cricket |
| 569 | 580 |
| 570 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 581 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
| OLD | NEW |