From a9b67ceab6c44c9a67dc759e0b4c161755c328e4 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Thu, 16 Jan 2020 14:00:44 -0800 Subject: [PATCH] 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 Commit-Queue: Steve Anton Cr-Commit-Position: refs/heads/master@{#30289} --- pc/peer_connection_integrationtest.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index 58f5aa63fe..ad1181c4a3 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc @@ -4474,10 +4474,12 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, VerifyIceStates) { // background. caller()->CreateAndSetAndSignalOffer(); - ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted, - caller()->ice_connection_state()); - ASSERT_EQ(PeerConnectionInterface::kIceConnectionCompleted, - caller()->standardized_ice_connection_state()); + ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionCompleted, + caller()->ice_connection_state(), kDefaultTimeout, + fake_clock); + ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionCompleted, + caller()->standardized_ice_connection_state(), + kDefaultTimeout, fake_clock); // Verify that the observer was notified of the intermediate transitions. EXPECT_THAT(caller()->ice_connection_state_history(),