mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
Update web-platform-tests to revision 2b7dace05fc1869398ee24f84fda4c0e4c0455ae
This commit is contained in:
parent
b23125d590
commit
6c901de216
844 changed files with 19802 additions and 3093 deletions
43
tests/wpt/web-platform-tests/webrtc/RTCQuicStream.https.html
Normal file
43
tests/wpt/web-platform-tests/webrtc/RTCQuicStream.https.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>RTCQuicStream.https.html</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="RTCQuicTransport-helper.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// These tests are based on the following specification:
|
||||
// https://w3c.github.io/webrtc-quic/
|
||||
|
||||
// The following helper functions are called from RTCQuicTransport-helper.js:
|
||||
// makeQuicTransport
|
||||
|
||||
test(t => {
|
||||
const quicTransport = makeQuicTransport(t, []);
|
||||
const quicStream = quicTransport.createStream();
|
||||
assert_equals(quicStream.transport, quicTransport,
|
||||
'Expect transport to be set to the creating RTCQuicTransport.');
|
||||
assert_equals(quicStream.state, 'new', `Expect state to be 'new'.`);
|
||||
assert_equals(quicStream.readBufferedAmount, 0,
|
||||
'Expect read buffered amount to be 0.');
|
||||
assert_equals(quicStream.writeBufferedAmount, 0,
|
||||
'Expect write buffered amount to be 0.');
|
||||
}, 'createStream() returns an RTCQuicStream with initial properties set.');
|
||||
|
||||
test(t => {
|
||||
const quicTransport = makeQuicTransport(t, []);
|
||||
quicTransport.stop();
|
||||
assert_throws('InvalidStateError', () => quicTransport.createStream());
|
||||
}, 'createStream() throws if the transport is closed.');
|
||||
|
||||
test(t => {
|
||||
const quicTransport = makeQuicTransport(t, []);
|
||||
const firstQuicStream = quicTransport.createStream();
|
||||
const secondQuicStream = quicTransport.createStream();
|
||||
quicTransport.stop();
|
||||
assert_equals(firstQuicStream.state, 'closed');
|
||||
assert_equals(secondQuicStream.state, 'closed');
|
||||
}, 'RTCQuicTransport.stop() closes all streams.');
|
||||
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
function makeQuicTransport(t, certificates) {
|
||||
const iceTransport = new RTCIceTransport();
|
||||
t.add_cleanup(() => iceTransport.stop());
|
||||
const quicTransport = new RTCQuicTransport(iceTransport, certificates);
|
||||
t.add_cleanup(() => quicTransport.stop());
|
||||
return quicTransport;
|
||||
}
|
||||
|
|
@ -3,19 +3,15 @@
|
|||
<title>RTCQuicTransport.https.html</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="RTCQuicTransport-helper.js"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// These tests are based on the following specification:
|
||||
// https://w3c.github.io/webrtc-quic/
|
||||
|
||||
function makeQuicTransport(t, certificates) {
|
||||
const iceTransport = new RTCIceTransport();
|
||||
t.add_cleanup(() => iceTransport.stop());
|
||||
const quicTransport = new RTCQuicTransport(iceTransport, certificates);
|
||||
t.add_cleanup(() => quicTransport.stop());
|
||||
return quicTransport;
|
||||
}
|
||||
// The following helper functions are called from RTCQuicTransport-helper.js:
|
||||
// makeQuicTransport
|
||||
|
||||
function generateCertificate(keygenAlgorithm) {
|
||||
return RTCPeerConnection.generateCertificate({
|
||||
|
|
|
@ -37,9 +37,9 @@ This test uses the legacy callback API with no media, and thus does not require
|
|||
var parsedOffer = new RTCSessionDescription({ type: 'offer',
|
||||
sdp: offerSdp });
|
||||
// These functions use the legacy interface extensions to RTCPeerConnection.
|
||||
gSecondConnection.setRemoteDescription(parsedOffer,
|
||||
gSecondConnection.setRemoteDescription(parsedOffer).then(
|
||||
function() {
|
||||
gSecondConnection.createAnswer(onAnswerCreated,
|
||||
gSecondConnection.createAnswer().then(onAnswerCreated,
|
||||
failed('createAnswer'));
|
||||
},
|
||||
failed('setRemoteDescription second'));
|
||||
|
@ -56,7 +56,7 @@ This test uses the legacy callback API with no media, and thus does not require
|
|||
function handleAnswer(answerSdp) {
|
||||
var parsedAnswer = new RTCSessionDescription({ type: 'answer',
|
||||
sdp: answerSdp });
|
||||
gFirstConnection.setRemoteDescription(parsedAnswer, ignoreSuccess,
|
||||
gFirstConnection.setRemoteDescription(parsedAnswer).then(ignoreSuccess,
|
||||
failed('setRemoteDescription first'));
|
||||
};
|
||||
|
||||
|
@ -125,8 +125,8 @@ This test uses the legacy callback API with no media, and thus does not require
|
|||
|
||||
// The offerToReceiveVideo is necessary and sufficient to make
|
||||
// an actual connection.
|
||||
gFirstConnection.createOffer(onOfferCreated, failed('createOffer'),
|
||||
{offerToReceiveVideo: true});
|
||||
gFirstConnection.createOffer({offerToReceiveVideo: true})
|
||||
.then(onOfferCreated, failed('createOffer'));
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
localStream.getTracks().forEach(function(track) {
|
||||
gFirstConnection.addTrack(track, localStream);
|
||||
});
|
||||
gFirstConnection.createOffer(onOfferCreated, failed('createOffer'));
|
||||
gFirstConnection.createOffer().then(onOfferCreated, failed('createOffer'));
|
||||
|
||||
var videoTag = document.getElementById('local-view');
|
||||
videoTag.srcObject = localStream;
|
||||
|
@ -59,7 +59,7 @@
|
|||
sdp: offerSdp });
|
||||
gSecondConnection.setRemoteDescription(parsedOffer);
|
||||
|
||||
gSecondConnection.createAnswer(onAnswerCreated,
|
||||
gSecondConnection.createAnswer().then(onAnswerCreated,
|
||||
failed('createAnswer'));
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue