Don't pretend we've received an end-of-candidates indication.

Since end-of-candidates signalling isn't implemented yet, the ice transport shouldn't reach completed. We also shouldn't assume that the transport has failed because gathering is complete without candidates, as we might still get remote candidates.

Bug: chromium:922588
Change-Id: I332f57be494efc775819d80908e9f39610311f82
Reviewed-on: https://webrtc-review.googlesource.com/c/118741
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26365}
This commit is contained in:
Jonas Olsson
2019-01-22 11:21:00 +01:00
committed by Commit Bot
parent 28522dc6e3
commit df919fb425
3 changed files with 10 additions and 21 deletions

View File

@ -394,7 +394,7 @@ IceTransportState P2PTransportChannel::ComputeState() const {
// Compute the current RTCIceTransportState as described in
// https://www.w3.org/TR/webrtc/#dom-rtcicetransportstate
// TODO(bugs.webrtc.org/9218): Avoid prematurely signalling kFailed once we have
// TODO(bugs.webrtc.org/9218): Start signaling kCompleted once we have
// implemented end-of-candidates signalling.
webrtc::IceTransportState P2PTransportChannel::ComputeIceTransportState()
const {
@ -413,23 +413,12 @@ webrtc::IceTransportState P2PTransportChannel::ComputeIceTransportState()
return webrtc::IceTransportState::kFailed;
}
switch (gathering_state_) {
case kIceGatheringComplete:
if (has_connection)
return webrtc::IceTransportState::kCompleted;
else
return webrtc::IceTransportState::kFailed;
case kIceGatheringNew:
return webrtc::IceTransportState::kNew;
case kIceGatheringGathering:
if (has_connection)
return webrtc::IceTransportState::kConnected;
else
return webrtc::IceTransportState::kChecking;
default:
RTC_NOTREACHED();
return webrtc::IceTransportState::kFailed;
}
if (gathering_state_ == kIceGatheringNew)
return webrtc::IceTransportState::kNew;
else if (has_connection)
return webrtc::IceTransportState::kConnected;
else
return webrtc::IceTransportState::kChecking;
}
void P2PTransportChannel::SetIceParameters(const IceParameters& ice_params) {

View File

@ -4146,7 +4146,7 @@ TEST_F(P2PTransportChannelPingTest, TestGetState) {
Connection* conn1 = WaitForConnectionTo(&ch, "1.1.1.1", 1, &clock);
Connection* conn2 = WaitForConnectionTo(&ch, "2.2.2.2", 2, &clock);
// Gathering complete with candidates.
EXPECT_EQ(webrtc::IceTransportState::kCompleted, ch.GetIceTransportState());
EXPECT_EQ(webrtc::IceTransportState::kConnected, ch.GetIceTransportState());
ASSERT_TRUE(conn1 != nullptr);
ASSERT_TRUE(conn2 != nullptr);
// Now there are two connections, so the transport channel is connecting.

View File

@ -3827,7 +3827,7 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, VerifyIceStates) {
ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted,
caller()->ice_connection_state());
ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted,
ASSERT_EQ(PeerConnectionInterface::kIceConnectionConnected,
caller()->standardized_ice_connection_state());
// Verify that the observer was notified of the intermediate transitions.
@ -3860,7 +3860,7 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, VerifyIceStates) {
RTC_LOG(LS_INFO) << "Firewall rules cleared";
ASSERT_EQ_WAIT(PeerConnectionInterface::kIceConnectionCompleted,
caller()->ice_connection_state(), kDefaultTimeout);
ASSERT_EQ_WAIT(PeerConnectionInterface::kIceConnectionCompleted,
ASSERT_EQ_WAIT(PeerConnectionInterface::kIceConnectionConnected,
caller()->standardized_ice_connection_state(),
kDefaultTimeout);