Replace the IceConnectionState implementation.

PeerConnection::ice_connection_state() used to return a value based on both DTLS and ICE transports.
Now that we have PeerConnection::peer_connection_state() to fill that role we can change the implementation of ice_connection_state over to match the spec.

Bug: webrtc:6145
Change-Id: Ia4f348f728f24faf4b976c63dea2187bb1f01ef0
Reviewed-on: https://webrtc-review.googlesource.com/c/108780
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25773}
This commit is contained in:
Jonas Olsson
2018-11-22 16:50:37 +01:00
committed by Commit Bot
parent 57f3ad0f8d
commit 1e87b4f32b
11 changed files with 156 additions and 226 deletions

View File

@ -820,6 +820,7 @@ public class PeerConnectionTest {
sdpLatch = new SdpObserverLatch();
answeringExpectations.expectSignalingChange(SignalingState.STABLE);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringPC.setLocalDescription(sdpLatch, answerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
@ -827,6 +828,7 @@ public class PeerConnectionTest {
sdpLatch = new SdpObserverLatch();
offeringExpectations.expectSignalingChange(SignalingState.HAVE_LOCAL_OFFER);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringPC.setLocalDescription(sdpLatch, offerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
@ -834,7 +836,6 @@ public class PeerConnectionTest {
offeringExpectations.expectSignalingChange(SignalingState.STABLE);
offeringExpectations.expectAddStream("answeredMediaStream");
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
offeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
@ -844,8 +845,9 @@ public class PeerConnectionTest {
//
// offeringExpectations.expectIceConnectionChange(
// IceConnectionState.COMPLETED);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
answeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTED);
offeringPC.setRemoteDescription(sdpLatch, answerSdp);
@ -1056,6 +1058,7 @@ public class PeerConnectionTest {
sdpLatch = new SdpObserverLatch();
answeringExpectations.expectSignalingChange(SignalingState.STABLE);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringPC.setLocalDescription(sdpLatch, answerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
@ -1063,21 +1066,22 @@ public class PeerConnectionTest {
sdpLatch = new SdpObserverLatch();
offeringExpectations.expectSignalingChange(SignalingState.HAVE_LOCAL_OFFER);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringPC.setLocalDescription(sdpLatch, offerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
sdpLatch = new SdpObserverLatch();
offeringExpectations.expectSignalingChange(SignalingState.STABLE);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
offeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTED);
// TODO(bemasc): uncomment once delivery of ICECompleted is reliable
// (https://code.google.com/p/webrtc/issues/detail?id=3021).
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
answeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTED);
offeringPC.setRemoteDescription(sdpLatch, answerSdp);
@ -1212,6 +1216,7 @@ public class PeerConnectionTest {
offeringExpectations.expectIceCandidates(2);
offeringExpectations.expectIceGatheringChange(IceGatheringState.COMPLETE);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringPC.setLocalDescription(sdpLatch, offerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
@ -1244,6 +1249,7 @@ public class PeerConnectionTest {
answeringExpectations.expectIceCandidates(2);
answeringExpectations.expectIceGatheringChange(IceGatheringState.COMPLETE);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringPC.setLocalDescription(sdpLatch, answerSdp);
assertTrue(sdpLatch.await());
assertNull(sdpLatch.getSdp());
@ -1253,7 +1259,6 @@ public class PeerConnectionTest {
offeringExpectations.expectSignalingChange(SignalingState.STABLE);
offeringExpectations.expectAddStream("answeredMediaStream");
offeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
offeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
offeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
offeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
@ -1263,8 +1268,9 @@ public class PeerConnectionTest {
//
// offeringExpectations.expectIceConnectionChange(
// IceConnectionState.COMPLETED);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CHECKING);
answeringExpectations.expectIceConnectionChange(IceConnectionState.CONNECTED);
answeringExpectations.expectConnectionChange(PeerConnectionState.NEW);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTING);
answeringExpectations.expectConnectionChange(PeerConnectionState.CONNECTED);
offeringPC.setRemoteDescription(sdpLatch, answerSdp);