mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 3bfdeb8976fc51748935c8d1f1014dfba8e08dfb
This commit is contained in:
parent
fcd6beb608
commit
cb63cfd5c7
185 changed files with 3083 additions and 1074 deletions
|
@ -234,4 +234,40 @@
|
|||
closed
|
||||
The RTCIceTransport has shut down and is no longer responding to STUN requests.
|
||||
*/
|
||||
promise_test(async t => {
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
const callee = new RTCPeerConnection();
|
||||
t.add_cleanup(() => callee.close());
|
||||
const stream = await navigator.mediaDevices.getUserMedia({audio: true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
const [track] = stream.getTracks();
|
||||
caller.addTrack(track, stream);
|
||||
|
||||
await doSignalingHandshake(caller, callee);
|
||||
|
||||
assert_equals(caller.iceConnectionState, 'new');
|
||||
assert_equals(callee.iceConnectionState, 'new');
|
||||
}, 'connectionState remains new when not adding remote ice candidates');
|
||||
|
||||
promise_test(async t => {
|
||||
|
||||
const caller = new RTCPeerConnection();
|
||||
t.add_cleanup(() => caller.close());
|
||||
const callee = new RTCPeerConnection();
|
||||
t.add_cleanup(() => callee.close());
|
||||
const stream = await navigator.mediaDevices.getUserMedia({audio: true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
const [track] = stream.getTracks();
|
||||
caller.addTrack(track, stream);
|
||||
|
||||
const states = [];
|
||||
caller.addEventListener('connectionstatechange', () => states.push(caller.connectionState));
|
||||
exchangeIceCandidates(caller, callee);
|
||||
await doSignalingHandshake(caller, callee);
|
||||
|
||||
await listenToConnected(caller);
|
||||
|
||||
assert_array_equals(states, ['connecting', 'connected']);
|
||||
}, 'connectionState transitions to connected via connecting');
|
||||
</script>
|
|
@ -217,10 +217,10 @@ function listenToIceConnected(pc) {
|
|||
resolve();
|
||||
return;
|
||||
}
|
||||
pc.oniceconnectionstatechange = () => {
|
||||
pc.addEventListener('iceconnectionstatechange', () => {
|
||||
if (isConnected(pc))
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -148,21 +148,21 @@ async_test(t => {
|
|||
const { iceConnectionState } = pc1;
|
||||
|
||||
if(iceConnectionState === 'checking') {
|
||||
const iceTransport = pc1.sctp.transport.iceTransport;
|
||||
const iceTransport = pc1.sctp.transport.transport;
|
||||
|
||||
assert_equals(iceTransport.state, 'checking',
|
||||
'Expect ICE transport to be in checking state when' +
|
||||
' iceConnectionState is checking');
|
||||
|
||||
} else if(iceConnectionState === 'connected') {
|
||||
const iceTransport = pc1.sctp.transport.iceTransport;
|
||||
const iceTransport = pc1.sctp.transport.transport;
|
||||
|
||||
assert_equals(iceTransport.state, 'connected',
|
||||
'Expect ICE transport to be in connected state when' +
|
||||
' iceConnectionState is connected');
|
||||
|
||||
} else if(iceConnectionState === 'completed') {
|
||||
const iceTransport = pc1.sctp.transport.iceTransport;
|
||||
const iceTransport = pc1.sctp.transport.transport;
|
||||
|
||||
assert_equals(iceTransport.state, 'completed',
|
||||
'Expect ICE transport to be in connected state when' +
|
||||
|
|
|
@ -108,13 +108,13 @@
|
|||
const { iceGatheringState } = pc2;
|
||||
|
||||
if(iceGatheringState === 'gathering') {
|
||||
const iceTransport = pc2.sctp.transport.iceTransport;
|
||||
const iceTransport = pc2.sctp.transport.transport;
|
||||
|
||||
assert_equals(iceTransport.gatheringState, 'gathering',
|
||||
'Expect ICE transport to be in checking gatheringState when iceGatheringState is checking');
|
||||
|
||||
} else if(iceGatheringState === 'complete') {
|
||||
const iceTransport = pc2.sctp.transport.iceTransport;
|
||||
const iceTransport = pc2.sctp.transport.transport;
|
||||
|
||||
assert_equals(iceTransport.gatheringState, 'complete',
|
||||
'Expect ICE transport to be in complete gatheringState when iceGatheringState is complete');
|
||||
|
|
|
@ -171,4 +171,19 @@
|
|||
pc.setLocalDescription(answer)));
|
||||
}, 'Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidStateError');
|
||||
|
||||
promise_test(async t => {
|
||||
const pc1 = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc1.close());
|
||||
const pc2 = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc2.close());
|
||||
|
||||
const offer = await pc1.createOffer({offerToReceiveAudio: true});
|
||||
await pc2.setRemoteDescription(offer);
|
||||
const answer = await pc2.createAnswer(); // [[LastAnswer]] slot set
|
||||
await pc2.setRemoteDescription({type: "rollback"});
|
||||
await pc2.createOffer({offerToReceiveVideo: true}); // [[LastOffer]] slot set
|
||||
await pc2.setRemoteDescription(offer);
|
||||
await pc2.setLocalDescription(answer); // Should check against [[LastAnswer]], not [[LastOffer]]
|
||||
}, "Setting previously generated answer after a call to createOffer should work");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -157,4 +157,18 @@
|
|||
}))));
|
||||
}, 'Creating and setting offer multiple times should succeed');
|
||||
|
||||
promise_test(async t => {
|
||||
const pc1 = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc1.close());
|
||||
const pc2 = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc2.close());
|
||||
|
||||
const offer = await pc1.createOffer({offerToReceiveAudio: true}); // [[LastOffer]] set
|
||||
const offer2 = await pc2.createOffer({offerToReceiveVideo: true});
|
||||
await pc1.setRemoteDescription(offer2);
|
||||
await pc1.createAnswer(); // [[LastAnswer]] set
|
||||
await pc1.setRemoteDescription({type: "rollback"});
|
||||
await pc1.setLocalDescription(offer);
|
||||
}, "Setting previously generated offer after a call to createAnswer should work");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -102,7 +102,7 @@ function asyncInit() {
|
|||
|
||||
idl_test(
|
||||
['webrtc'],
|
||||
['mediacapture-streams', 'dom'],
|
||||
['mediacapture-streams', 'dom', 'html'],
|
||||
async idlArray => {
|
||||
idlArray.add_objects({
|
||||
RTCPeerConnection: [`new RTCPeerConnection()`],
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>RTCPeerConnection Simulcast Answer</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// Tests for the construction of answers with simulcast according to:
|
||||
// draft-ietf-mmusic-sdp-simulcast-13
|
||||
// draft-ietf-mmusic-rid-15
|
||||
promise_test(async t => {
|
||||
const pc = new RTCPeerConnection();
|
||||
t.add_cleanup(() => pc.close());
|
||||
const expected_rids = ['foo', 'bar', 'baz'];
|
||||
|
||||
const offer_sdp = `v=0
|
||||
o=- 3840232462471583827 2 IN IP4 127.0.0.1
|
||||
s=-
|
||||
t=0 0
|
||||
a=group:BUNDLE 0
|
||||
a=msid-semantic: WMS
|
||||
m=video 9 UDP/TLS/RTP/SAVPF 96
|
||||
c=IN IP4 0.0.0.0
|
||||
a=rtcp:9 IN IP4 0.0.0.0
|
||||
a=ice-ufrag:Li6+
|
||||
a=ice-pwd:3C05CTZBRQVmGCAq7hVasHlT
|
||||
a=ice-options:trickle
|
||||
a=fingerprint:sha-256 5B:D3:8E:66:0E:7D:D3:F3:8E:E6:80:28:19:FC:55:AD:58:5D:B9:3D:A8:DE:45:4A:E7:87:02:F8:3C:0B:3B:B3
|
||||
a=setup:actpass
|
||||
a=mid:0
|
||||
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
|
||||
a=recvonly
|
||||
a=rtcp-mux
|
||||
a=rtpmap:96 VP8/90000
|
||||
a=rtcp-fb:96 goog-remb
|
||||
a=rtcp-fb:96 transport-cc
|
||||
a=rtcp-fb:96 ccm fir
|
||||
a=rid:foo send
|
||||
a=rid:bar send
|
||||
a=rid:baz send
|
||||
a=simulcast:recv foo;bar;baz
|
||||
`;
|
||||
|
||||
await pc.setRemoteDescription({type: 'offer', sdp: offer_sdp});
|
||||
const transceiver = pc.getTransceivers()[0];
|
||||
// The created transceiver should be in "recvonly" state. Allow it to send.
|
||||
transceiver.direction = "sendonly";
|
||||
const answer = await pc.createAnswer();
|
||||
let answer_lines = answer.sdp.split('\r\n');
|
||||
// Check for a RID line for each layer.
|
||||
for (const rid of expected_rids) {
|
||||
let result = answer_lines.find(line => line.startsWith(`a=rid:${rid}`));
|
||||
assert_not_equals(result, undefined, `RID attribute for '${rid}' missing.`);
|
||||
}
|
||||
|
||||
// Check for simulcast attribute with send direction and all RIDs.
|
||||
let result = answer_lines.find(
|
||||
line => line.startsWith(`a=simulcast:send ${expected_rids.join(';')}`));
|
||||
assert_not_equals(result, undefined, "Could not find simulcast attribute.");
|
||||
}, 'createOffer() with multiple send encodings should create simulcast offer');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue