Don't transition ICE to Checking if there are no transports
This attempts to make it more clear that an offer or answer with no transports will no start ICE. Bug: None Change-Id: Ifb8d9e445b8fbef1fb1590477dd6bdb4fc651a90 Reviewed-on: https://webrtc-review.googlesource.com/73640 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23070}
This commit is contained in:
@ -2348,6 +2348,7 @@ RTCError PeerConnection::ApplyRemoteDescription(
|
||||
// read to determine the current checking state. The existing SignalConnecting
|
||||
// actually means "gathering candidates", so cannot be be used here.
|
||||
if (remote_description()->GetType() != SdpType::kOffer &&
|
||||
remote_description()->number_of_mediasections() > 0u &&
|
||||
ice_connection_state() == PeerConnectionInterface::kIceConnectionNew) {
|
||||
SetIceConnectionState(PeerConnectionInterface::kIceConnectionChecking);
|
||||
}
|
||||
|
@ -351,6 +351,21 @@ TEST_P(PeerConnectionIceTest, SetRemoteDescriptionFailsIfNoIceCredentials) {
|
||||
EXPECT_FALSE(callee->SetRemoteDescription(std::move(offer)));
|
||||
}
|
||||
|
||||
// Test that doing an offer/answer exchange with no transport (i.e., no data
|
||||
// channel or media) results in the ICE connection state staying at New.
|
||||
TEST_P(PeerConnectionIceTest,
|
||||
OfferAnswerWithNoTransportsDoesNotChangeIceConnectionState) {
|
||||
auto caller = CreatePeerConnection();
|
||||
auto callee = CreatePeerConnection();
|
||||
|
||||
ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get()));
|
||||
|
||||
EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew,
|
||||
caller->pc()->ice_connection_state());
|
||||
EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew,
|
||||
callee->pc()->ice_connection_state());
|
||||
}
|
||||
|
||||
// The following group tests that ICE candidates are not generated before
|
||||
// SetLocalDescription is called on a PeerConnection.
|
||||
|
||||
|
Reference in New Issue
Block a user