| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "webrtc/api/audiotrack.h" | 15 #include "webrtc/api/audiotrack.h" |
| 16 #include "webrtc/api/fakemediacontroller.h" | 16 #include "webrtc/api/fakemediacontroller.h" |
| 17 #include "webrtc/api/fakemetricsobserver.h" | 17 #include "webrtc/api/fakemetricsobserver.h" |
| 18 #include "webrtc/api/jsepicecandidate.h" | 18 #include "webrtc/api/jsepicecandidate.h" |
| 19 #include "webrtc/api/jsepsessiondescription.h" | 19 #include "webrtc/api/jsepsessiondescription.h" |
| 20 #include "webrtc/api/peerconnection.h" | 20 #include "webrtc/api/peerconnection.h" |
| 21 #include "webrtc/api/sctputils.h" | 21 #include "webrtc/api/sctputils.h" |
| 22 #include "webrtc/api/test/fakertccertificategenerator.h" | 22 #include "webrtc/api/test/fakertccertificategenerator.h" |
| 23 #include "webrtc/api/videotrack.h" | 23 #include "webrtc/api/videotrack.h" |
| 24 #include "webrtc/api/webrtcsession.h" | 24 #include "webrtc/api/webrtcsession.h" |
| 25 #include "webrtc/api/webrtcsessiondescriptionfactory.h" | 25 #include "webrtc/api/webrtcsessiondescriptionfactory.h" |
| 26 #include "webrtc/base/checks.h" |
| 26 #include "webrtc/base/fakenetwork.h" | 27 #include "webrtc/base/fakenetwork.h" |
| 27 #include "webrtc/base/firewallsocketserver.h" | 28 #include "webrtc/base/firewallsocketserver.h" |
| 28 #include "webrtc/base/gunit.h" | 29 #include "webrtc/base/gunit.h" |
| 29 #include "webrtc/base/logging.h" | 30 #include "webrtc/base/logging.h" |
| 30 #include "webrtc/base/network.h" | 31 #include "webrtc/base/network.h" |
| 31 #include "webrtc/base/physicalsocketserver.h" | 32 #include "webrtc/base/physicalsocketserver.h" |
| 32 #include "webrtc/base/ssladapter.h" | 33 #include "webrtc/base/ssladapter.h" |
| 33 #include "webrtc/base/sslidentity.h" | 34 #include "webrtc/base/sslidentity.h" |
| 34 #include "webrtc/base/sslstreamadapter.h" | 35 #include "webrtc/base/sslstreamadapter.h" |
| 35 #include "webrtc/base/stringutils.h" | 36 #include "webrtc/base/stringutils.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // Found a new candidate. | 183 // Found a new candidate. |
| 183 void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override { | 184 void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override { |
| 184 switch (candidate->sdp_mline_index()) { | 185 switch (candidate->sdp_mline_index()) { |
| 185 case kMediaContentIndex0: | 186 case kMediaContentIndex0: |
| 186 mline_0_candidates_.push_back(candidate->candidate()); | 187 mline_0_candidates_.push_back(candidate->candidate()); |
| 187 break; | 188 break; |
| 188 case kMediaContentIndex1: | 189 case kMediaContentIndex1: |
| 189 mline_1_candidates_.push_back(candidate->candidate()); | 190 mline_1_candidates_.push_back(candidate->candidate()); |
| 190 break; | 191 break; |
| 191 default: | 192 default: |
| 192 ASSERT(false); | 193 RTC_NOTREACHED(); |
| 193 } | 194 } |
| 194 | 195 |
| 195 // The ICE gathering state should always be Gathering when a candidate is | 196 // The ICE gathering state should always be Gathering when a candidate is |
| 196 // received (or possibly Completed in the case of the final candidate). | 197 // received (or possibly Completed in the case of the final candidate). |
| 197 EXPECT_NE(PeerConnectionInterface::kIceGatheringNew, ice_gathering_state_); | 198 EXPECT_NE(PeerConnectionInterface::kIceGatheringNew, ice_gathering_state_); |
| 198 } | 199 } |
| 199 | 200 |
| 200 // Some local candidates are removed. | 201 // Some local candidates are removed. |
| 201 void OnIceCandidatesRemoved( | 202 void OnIceCandidatesRemoved( |
| 202 const std::vector<cricket::Candidate>& candidates) override { | 203 const std::vector<cricket::Candidate>& candidates) override { |
| (...skipping 4239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4442 } | 4443 } |
| 4443 | 4444 |
| 4444 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4445 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4445 // currently fails because upon disconnection and reconnection OnIceComplete is | 4446 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4446 // called more than once without returning to IceGatheringGathering. | 4447 // called more than once without returning to IceGatheringGathering. |
| 4447 | 4448 |
| 4448 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4449 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4449 WebRtcSessionTest, | 4450 WebRtcSessionTest, |
| 4450 testing::Values(ALREADY_GENERATED, | 4451 testing::Values(ALREADY_GENERATED, |
| 4451 DTLS_IDENTITY_STORE)); | 4452 DTLS_IDENTITY_STORE)); |
| OLD | NEW |