mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 13:18:45 +02:00
Automatic update from web-platform-tests Fix RTCRtpReceiver-getContributingSources.https.html flake. The flake was "Failed to execute 'addTrack' on 'RTCPeerConnection': The RTCPeerConnection's signalingState is 'closed'." The promise_test could be torn down and execute t.add_cleanup(() => pc1.close()); before connectAndExpectNoCsrcs() was ready due to not using "await" when calling the test helper method. TBR=hta@chromium.org NOTRY=True // See https://github.com/web-platform-tests/wpt/pull/14791 Bug: None Change-Id: I1dac26837b3f29b8f1c38709c7a8488d0e2580c7 Reviewed-on: https://chromium-review.googlesource.com/c/1424891 Reviewed-by: Henrik Boström <hbos@chromium.org> Reviewed-by: Harald Alvestrand <hta@chromium.org> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#624622} -- wpt-commits: b69756a11fc522b8cf03858f14d4c0acdf98cd1e wpt-pr: 14978
35 lines
1.2 KiB
HTML
35 lines
1.2 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>RTCRtpReceiver.prototype.getContributingSources</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="RTCPeerConnection-helper.js"></script>
|
|
<script>
|
|
'use strict';
|
|
|
|
async function connectAndExpectNoCsrcs(t, kind) {
|
|
const pc1 = new RTCPeerConnection();
|
|
t.add_cleanup(() => pc1.close());
|
|
const pc2 = new RTCPeerConnection();
|
|
t.add_cleanup(() => pc2.close());
|
|
|
|
const stream = await navigator.mediaDevices.getUserMedia({[kind]:true});
|
|
const [track] = stream.getTracks();
|
|
t.add_cleanup(() => track.stop());
|
|
pc1.addTrack(track, stream);
|
|
|
|
exchangeIceCandidates(pc1, pc2);
|
|
const trackEvent = await exchangeOfferAndListenToOntrack(t, pc1, pc2);
|
|
await exchangeAnswer(pc1, pc2);
|
|
|
|
assert_array_equals(trackEvent.receiver.getContributingSources(), []);
|
|
}
|
|
|
|
promise_test(async t => {
|
|
await connectAndExpectNoCsrcs(t, 'audio');
|
|
}, '[audio] getContributingSources() returns an empty list in loopback call');
|
|
|
|
promise_test(async t => {
|
|
await connectAndExpectNoCsrcs(t, 'video');
|
|
}, '[video] getContributingSources() returns an empty list in loopback call');
|
|
</script>
|