gecko-dev/testing/web-platform/tests/webrtc/RTCPeerConnection-restartIce-onnegotiationneeded.https.html
Henrik Boström 983e7d0138 Bug 1567547 [wpt PR 17939] - Implement RTCPeerConnection.restartIce() according to spec., a=testonly
Automatic update from web-platform-tests
Implement RTCPeerConnection.restartIce() according to spec.

This is part of "Perfect Negotiation" (https://crbug.com/980872).
Spec: https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-restartice

Intent to Ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/OqPfCpC5RYU

The restartIce() makes the next createOffer() generate new ICE
credentials, as if {iceRestart:true} was passed in as options. It also
causes negotiationneeded. This is better than manually restarting ICE
because it survives rollbacks (when that is implemented) and
restartIce() can be called regardless of current signalingState.
Problems with {restartIce:true} is described here:
https://docs.google.com/presentation/d/1xcvf0udNeSH7s1FOY7RRqr1dEFvokZjn-MZPjwy3iXQ/edit#slide=id.g5c2f3df65b_11_574

Bug: chromium:980881
Change-Id: Iaeb32d39d3ec514f19eb95150c3df257bcb5c754
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1708139
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680800}

--

wpt-commits: 398506e656a7b1c24060f2d2135f6d2ec642e90c
wpt-pr: 17939
2019-08-05 14:49:35 +00:00

29 lines
1 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="RTCPeerConnection-helper.js"></script>
<script>
"use strict";
promise_test(async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
t.add_cleanup(() => pc2.close());
pc1.addTransceiver("audio");
await pc1.setLocalDescription(await pc1.createOffer());
pc1.restartIce();
await pc2.setRemoteDescription(pc1.localDescription);
await pc2.setLocalDescription(await pc2.createAnswer());
await pc1.setRemoteDescription(pc2.localDescription);
// When the setRemoteDescription() promise above is resolved a task should be
// queued to fire the onnegotiationneeded event. Because of this, we should
// have time to hook up the event listener *after* awaiting the SRD promise.
await new Promise(r => pc1.onnegotiationneeded = r);
}, "Negotiation needed when returning to stable does not fire too early");
</script>