Explicitly wait for ICE state to transition to 'completed' in VerifyIceStates

The test previously assumed that doing an offer/answer exchange would
leave the ICE state completed which is unlikely in practice but probably
worked most of the time in test since the network components were faked.

Bug: webrtc:11280
Change-Id: I9bc0e1490b0b8401cc832b73da9dc7fe870bc9fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166400
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30289}
This commit is contained in:
Steve Anton
2020-01-16 14:00:44 -08:00
committed by Commit Bot
parent 3f0bc2c176
commit a9b67ceab6

View File

@ -4474,10 +4474,12 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, VerifyIceStates) {
// background. // background.
caller()->CreateAndSetAndSignalOffer(); caller()->CreateAndSetAndSignalOffer();
ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted, ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionCompleted,
caller()->ice_connection_state()); caller()->ice_connection_state(), kDefaultTimeout,
ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted, fake_clock);
caller()->standardized_ice_connection_state()); ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionCompleted,
caller()->standardized_ice_connection_state(),
kDefaultTimeout, fake_clock);
// Verify that the observer was notified of the intermediate transitions. // Verify that the observer was notified of the intermediate transitions.
EXPECT_THAT(caller()->ice_connection_state_history(), EXPECT_THAT(caller()->ice_connection_state_history(),