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}
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index 58f5aa6..ad1181c 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -4474,10 +4474,12 @@
   // 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(),