Automatic update from web-platform-tests [Gecko Bug 2019841] Calibrate which webrtc subtests are part of interop-2026 based on 2pass + test for webrrtc-pc#3094 (#58432) * Calibrate which webrtc subtests are part of interop-2026 based on 2pass. Differential Revision: https://phabricator.services.mozilla.com/D286144 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2019841 gecko-commit: 02c6cc15d044d903ffa2cc53d678b79524d6eafa gecko-reviewers: bwc * add WPT test for SctpTransport exposure and rollback during negotiation. Differential Revision: https://phabricator.services.mozilla.com/D286278 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2019841 gecko-commit: 50d04a0ff89a96633000a1cf9428ae6d988c5272 gecko-reviewers: bwc --------- Co-authored-by: Jan-Ivar Bruaroey <jib@mozilla.com> -- wpt-commits: ceaa1c0dc913b4e5248d49e820fcbf54276a2a69 wpt-pr: 58432
157 lines
5.8 KiB
HTML
157 lines
5.8 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>RTCRtpTransceiver.prototype.stop</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="RTCPeerConnection-helper.js"></script>
|
|
<script>
|
|
|
|
// FIXME: Add a test adding a transceiver, stopping it and trying to create an empty offer.
|
|
|
|
promise_test(async (t)=> {
|
|
const pc1 = new RTCPeerConnection();
|
|
t.add_cleanup(() => pc1.close());
|
|
|
|
pc1.addTransceiver("audio", { direction: "sendonly" });
|
|
pc1.addTransceiver("video");
|
|
pc1.getTransceivers()[0].stop();
|
|
|
|
const offer = await pc1.createOffer();
|
|
|
|
assert_false(offer.sdp.includes("m=audio"), "offer should not contain an audio m-section");
|
|
assert_true(offer.sdp.includes("m=video"), "offer should contain a video m-section");
|
|
}, "A transceiver added and stopped before the initial offer generation should not trigger an offer m-section generation");
|
|
|
|
promise_test(async (t)=> {
|
|
const pc1 = new RTCPeerConnection();
|
|
t.add_cleanup(() => pc1.close());
|
|
|
|
pc1.addTransceiver("audio", { direction: "sendonly" });
|
|
pc1.addTransceiver("video");
|
|
assert_equals(null, pc1.getTransceivers()[1].receiver.transport);
|
|
|
|
pc1.getTransceivers()[1].stop();
|
|
assert_equals(pc1.getTransceivers()[1].receiver.transport, null);
|
|
}, "A transceiver added and stopped should not crash when getting receiver's transport");
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
|
|
pc1.addTransceiver("video");
|
|
|
|
pc1.getTransceivers()[0].stop();
|
|
pc1.getTransceivers()[1].stop();
|
|
|
|
const offer = await pc1.createOffer();
|
|
|
|
assert_true(offer.sdp.includes("m=audio"), "offer should contain an audio m-section");
|
|
assert_true(offer.sdp.includes("m=audio 0"), "The audio m-section should be rejected");
|
|
|
|
assert_false(offer.sdp.includes("m=video"), "offer should not contain a video m-section");
|
|
}, "During renegotiation, adding and stopping a transceiver should not trigger a renegotiated offer m-section generation");
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
|
|
pc1.getTransceivers()[0].direction = "sendonly";
|
|
pc1.getTransceivers()[0].stop();
|
|
|
|
const offer = await pc1.createOffer();
|
|
|
|
assert_true(offer.sdp.includes("a=inactive"), "The audio m-section should be inactive");
|
|
}, "A stopped sendonly transceiver should generate an inactive m-section in the offer");
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
|
|
pc1.getTransceivers()[0].direction = "inactive";
|
|
pc1.getTransceivers()[0].stop();
|
|
|
|
const offer = await pc1.createOffer();
|
|
|
|
assert_true(offer.sdp.includes("a=inactive"), "The audio m-section should be inactive");
|
|
}, "A stopped inactive transceiver should generate an inactive m-section in the offer");
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
pc1.getTransceivers()[0].stop();
|
|
await exchangeOfferAnswer(pc1, pc2);
|
|
await pc1.setLocalDescription(await pc1.createOffer());
|
|
}, 'If a transceiver is stopped locally, setting a locally generated answer should still work');
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
pc2.getTransceivers()[0].stop();
|
|
await exchangeOfferAnswer(pc2, pc1);
|
|
await pc1.setLocalDescription(await pc1.createOffer());
|
|
}, 'If a transceiver is stopped remotely, setting a locally generated answer should still work');
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
assert_equals(pc1.getTransceivers().length, 1);
|
|
assert_equals(pc2.getTransceivers().length, 1);
|
|
pc1.getTransceivers()[0].stop();
|
|
await exchangeOfferAnswer(pc1, pc2);
|
|
assert_equals(pc1.getTransceivers().length, 0);
|
|
assert_equals(pc2.getTransceivers().length, 0);
|
|
assert_equals(pc1.getSenders().length, 0, 'caller senders');
|
|
assert_equals(pc1.getReceivers().length, 0, 'caller receivers');
|
|
assert_equals(pc2.getSenders().length, 0, 'callee senders');
|
|
assert_equals(pc2.getReceivers().length, 0, 'callee receivers');
|
|
}, 'If a transceiver is stopped, transceivers, senders and receivers should disappear after offer/answer');
|
|
|
|
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 exchangeOfferAnswer(pc1, pc2);
|
|
assert_equals(pc1.getTransceivers().length, 1);
|
|
assert_equals(pc2.getTransceivers().length, 1);
|
|
const [pc1Transceiver] = pc1.getTransceivers();
|
|
const [pc2Transceiver] = pc2.getTransceivers();
|
|
pc1.getTransceivers()[0].stop();
|
|
await exchangeOfferAnswer(pc1, pc2);
|
|
assert_equals(pc1Transceiver.direction, 'stopped');
|
|
assert_equals(pc2Transceiver.direction, 'stopped');
|
|
}, 'If a transceiver is stopped, transceivers should end up in state stopped');
|
|
|
|
</script>
|