summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/transport/test/transport_unittests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webrtc/transport/test/transport_unittests.cpp')
-rw-r--r--dom/media/webrtc/transport/test/transport_unittests.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/dom/media/webrtc/transport/test/transport_unittests.cpp b/dom/media/webrtc/transport/test/transport_unittests.cpp
index 7729151ade..0e9702ced8 100644
--- a/dom/media/webrtc/transport/test/transport_unittests.cpp
+++ b/dom/media/webrtc/transport/test/transport_unittests.cpp
@@ -586,16 +586,15 @@ class TransportTestPeer : public sigslot::has_slots<> {
void InitIce() {
nsresult res;
- // Attach our slots
- ice_ctx_->SignalGatheringStateChange.connect(
- this, &TransportTestPeer::GatheringStateChange);
-
char name[100];
snprintf(name, sizeof(name), "%s:stream%d", name_.c_str(),
(int)streams_.size());
// Create the media stream
RefPtr<NrIceMediaStream> stream = ice_ctx_->CreateStream(name, name, 1);
+ // Attach our slots
+ stream->SignalGatheringStateChange.connect(
+ this, &TransportTestPeer::GatheringStateChange);
ASSERT_TRUE(stream != nullptr);
stream->SetIceCredentials("ufrag", "pass");
@@ -639,9 +638,12 @@ class TransportTestPeer : public sigslot::has_slots<> {
<< std::endl;
}
- void GatheringStateChange(NrIceCtx* ctx, NrIceCtx::GatheringState state) {
- (void)ctx;
- if (state == NrIceCtx::ICE_CTX_GATHER_COMPLETE) {
+ void GatheringStateChange(const std::string& aTransportId,
+ NrIceMediaStream::GatheringState state) {
+ // We only use one stream, no need to check whether all streams are done
+ // gathering.
+ Unused << aTransportId;
+ if (state == NrIceMediaStream::ICE_STREAM_GATHER_COMPLETE) {
GatheringComplete();
}
}