Use callback version of AddIceCandidate in PC tests

Bug: webrtc:11798
Change-Id: I50919e744d24b47ffac8ba294e18a31dfa053a50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261245
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36835}
This commit is contained in:
Niels Möller
2022-05-05 09:30:35 +02:00
committed by WebRTC LUCI CQ
parent eb6c391478
commit 7ee45945da

View File

@ -27,6 +27,7 @@
#include <vector>
#include "absl/algorithm/container.h"
#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "api/audio_options.h"
#include "api/call/call_factory_interface.h"
@ -1045,9 +1046,12 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
int sdp_mline_index,
const std::string& msg) override {
RTC_LOG(LS_INFO) << debug_name_ << ": ReceiveIceMessage";
std::unique_ptr<webrtc::IceCandidateInterface> candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mline_index, msg, nullptr));
EXPECT_TRUE(pc()->AddIceCandidate(candidate.get()));
absl::optional<RTCError> result;
pc()->AddIceCandidate(absl::WrapUnique(webrtc::CreateIceCandidate(
sdp_mid, sdp_mline_index, msg, nullptr)),
[&result](RTCError r) { result = r; });
EXPECT_TRUE_WAIT(result.has_value(), kDefaultTimeout);
EXPECT_TRUE(result.value().ok());
}
// PeerConnectionObserver callbacks.