pc: invalidate stats cache when firing onicecandidate

https://w3c.github.io/webrtc-stats/#guidelines-for-getstats-results-caching-throttling
"When the state of the RTCPeerConnection visibly changes as a result of an API call, a promise resolving or an event firing, subsequent new getStats() calls must return up-to-date dictionaries for the affected objects."

BUG=webrtc:14190

Change-Id: I4560be22795f30e0369d573bda0100e490efb57b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265870
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37255}
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h
index 53df9fc..460148c 100644
--- a/pc/test/integration_test_helpers.h
+++ b/pc/test/integration_test_helpers.h
@@ -410,6 +410,11 @@
     return pc()->signaling_state() == webrtc::PeerConnectionInterface::kStable;
   }
 
+  bool IceGatheringStateComplete() {
+    return pc()->ice_gathering_state() ==
+           webrtc::PeerConnectionInterface::kIceGatheringComplete;
+  }
+
   void CreateDataChannel() { CreateDataChannel(nullptr); }
 
   void CreateDataChannel(const webrtc::DataChannelInit* init) {