Commit 84f1aaa8 authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

Fix race in track-stats.https.html test.

This resolves the onIceConnectionStateComplete probmise when
iceConnectionState reaches either 'connected' or 'completed' and fixes
the race if it had already reached these states before the function was
called.

This fix is speculative. I am no longer able to repro the TIMEOUT
locally with or without the fix.

Bug: 829401
Change-Id: I1dec90250d640d93498c59a932ab5e84a3b96f15
Reviewed-on: https://chromium-review.googlesource.com/1012029Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550580}
parent ed38892e
......@@ -2675,7 +2675,6 @@ crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription.html
crbug.com/626703 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCPeerConnection-setRemoteDescription.html [ Timeout ]
crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html [ Timeout ]
crbug.com/626703 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-rollback.html [ Timeout ]
crbug.com/829401 external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Pass Timeout ]
crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ]
crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ]
crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up.html [ Failure ]
......
......@@ -569,14 +569,20 @@
return stats;
}
// Returns a promise that is resolved when pc.iceConnectionState changes to
// 'completed'. This is when transport stats can be expected to have its
// selectedCandidatePairId defined.
// Returns a promise that is resolved when pc.iceConnectionState reaches the
// 'connected' or 'completed' state. This is when transport stats can be
// expected to have its selectedCandidatePairId defined.
async function onIceConnectionStateCompleted(pc) {
if (pc.iceConnectionState == 'connected' ||
pc.iceConnectionState == 'completed') {
return Promise.resolve();
}
let resolver = new Resolver();
pc.oniceconnectionstatechange = e => {
if (pc.iceConnectionState == 'completed')
if (pc.iceConnectionState == 'connected' ||
pc.iceConnectionState == 'completed') {
resolver.resolve();
}
};
return resolver.promise;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment