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:
@ -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) {
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user