mirror of
https://github.com/servo/servo.git
synced 2025-08-28 08:38:20 +01:00
Update web-platform-tests to revision 74bae78af4b95a2f0ca3a81df9c7fe3143f24bbc
This commit is contained in:
parent
fb95f9df9c
commit
02c1eed999
150 changed files with 2395 additions and 829 deletions
|
@ -0,0 +1,82 @@
|
|||
<!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();
|
||||
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=sendonly"), "The audio m-section should be sendonly");
|
||||
}, "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");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue