Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=230344 (#30820)

--

wpt-commits: 1d7142d51ed82a3401ab221ac5f54151c82f311b
wpt-pr: 30820
This commit is contained in:
youennf 2021-10-02 11:05:18 +00:00 коммит произвёл moz-wptsync-bot
Родитель c1542d3ee8
Коммит ffec542f4f
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -36,7 +36,7 @@ function peer(other, polite, fail = null) {
try {
pc.addEventListener("icecandidate", ({candidate}) => send(other,
{candidate}));
let makingOffer = false, ignoreOffer = false;
let makingOffer = false, ignoreIceCandidateFailures = false;
let srdAnswerPending = false;
pc.addEventListener("negotiationneeded", async () => {
try {
@ -63,14 +63,16 @@ function peer(other, polite, fail = null) {
let isStable =
pc.signalingState == "stable" ||
(pc.signalingState == "have-local-offer" && srdAnswerPending);
ignoreOffer = description.type == "offer" && !polite &&
const ignoreOffer = description.type == "offer" && !polite &&
(makingOffer || !isStable);
if (ignoreOffer) {
ignoreIceCandidateFailures = true;
return;
}
if (description.type == "answer")
srdAnswerPending = true;
await pc.setRemoteDescription(description);
ignoreIceCandidateFailures = false;
srdAnswerPending = false;
if (description.type == "offer") {
assert_equals(pc.signalingState, "have-remote-offer", "Remote offer");
@ -88,7 +90,7 @@ function peer(other, polite, fail = null) {
try {
await pc.addIceCandidate(candidate);
} catch (e) {
if (!ignoreOffer) throw e;
if (!ignoreIceCandidateFailures) throw e;
}
} else if (run) {
send(window.parent, {[run.id]: await commands[run.cmd]() || 0});