fune/testing/web-platform/tests/webrtc/RTCPeerConnection-SLD-SRD-timing.https.html
Henrik Boström bb4c106339 Bug 1655012 [wpt PR 24734] - [Perfect Negotiation] Migrate to non-racy setLocalDescription API., a=testonly
Automatic update from web-platform-tests
[Perfect Negotiation] Migrate to non-racy setLocalDescription API.

(Chromium follow-up to WebRTC CL
https://webrtc-review.googlesource.com/c/src/+/180481.)

This CL migrates to the non-racy version of SetLocalDescription, i.e.
a version of SLD that invokes its callback immediately when the
operation completes rather than with a delay, ensuring that SLD can
resolve with the right states.

This CL adds a WPT that verifies calling SLD and SRD in a way that
without this CL would fail.

This CL also makes the RTCPeerConnection-perfect-negotiation.https WPT
expectations predictable: In Unified Plan, we always pass the first two
tests and (due to https://crbug.com/1060083) always fail the remaining
ones. In Plan B, we always Timeout (addTransceiver throws
asynchronously leaving a promise unresolved).

Bug: chromium:1071733, chromium:1019232
Change-Id: I21025226bd86e94456cc9a8c3deb980170d8bed8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2292252
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793117}

--

wpt-commits: 4adb2b6fe39378c78d3b793ba984690237fee316
wpt-pr: 24734
2020-08-15 07:03:29 +00:00

24 lines
857 B
HTML

<!doctype html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
'use strict';
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const signalingStates = [];
pc.onsignalingstatechange = ev => signalingStates.push(pc.signalingState);
pc.addTransceiver('audio', {direction:'recvonly'});
const offer = await pc.createOffer();
const sldPromise = pc.setLocalDescription(offer);
const srdPromise = pc.setRemoteDescription(offer);
await Promise.all([sldPromise, srdPromise]);
assert_array_equals(signalingStates,
['have-local-offer','stable','have-remote-offer']);
}, 'setLocalDescription and setRemoteDescription are not racy');
</script>