Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -1,3 +1,4 @@
@dontcallmedom
@alvestrand
@phoglund
@agouaillard

View file

@ -73,10 +73,6 @@ This test uses the legacy callback API with no media, and thus does not require
}
});
var onRemoteStream = test.step_func(function(event) {
assert_unreached('WebRTC received a stream when there was none');
});
var onIceConnectionStateChange = test.step_func(function(event) {
assert_equals(event.type, 'iceconnectionstatechange');
assert_not_equals(gFirstConnection.iceConnectionState, "failed", "iceConnectionState of first connection");
@ -125,7 +121,6 @@ This test uses the legacy callback API with no media, and thus does not require
gSecondConnection = new RTCPeerConnection(null);
gSecondConnection.onicecandidate = onIceCandidateToSecond;
gSecondConnection.onaddstream = onRemoteStream;
gSecondConnection.oniceconnectionstatechange = onIceConnectionStateChange;
// The offerToReceiveVideo is necessary and sufficient to make

View file

@ -36,10 +36,6 @@ This test uses data only, and thus does not require fake media devices.
}
});
var onRemoteStream = test.step_func(function(event) {
assert_unreached('WebRTC received a stream when there was none');
});
var onIceConnectionStateChange = test.step_func(function(event) {
assert_equals(event.type, 'iceconnectionstatechange');
var stateinfo = document.getElementById('stateinfo');
@ -75,7 +71,6 @@ This test uses data only, and thus does not require fake media devices.
gSecondConnection = new RTCPeerConnection(null);
gSecondConnection.onicecandidate = onIceCandidateToSecond;
gSecondConnection.onaddstream = onRemoteStream;
gSecondConnection.oniceconnectionstatechange = onIceConnectionStateChange;
// The createDataChannel is necessary and sufficient to make

View file

@ -0,0 +1,58 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RTCPeerConnection canTrickleIceCandidates tests</title>
</head>
<body>
<!-- These files are in place when executing on W3C. -->
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
// tests support for RTCPeerConnection.canTrickleIceCandidates:
// http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-cantrickleicecandidates
const sdp = 'v=0\r\n' +
'o=- 166855176514521964 2 IN IP4 127.0.0.1\r\n' +
's=-\r\n' +
't=0 0\r\n' +
'a=ice-options:trickle\r\n' +
'm=audio 9 UDP/TLS/RTP/SAVPF 111\r\n' +
'c=IN IP4 0.0.0.0\r\n' +
'a=rtcp:9 IN IP4 0.0.0.0\r\n' +
'a=ice-ufrag:someufrag\r\n' +
'a=ice-pwd:somelongpwdwithenoughrandomness\r\n' +
'a=fingerprint:sha-256 8C:71:B3:8D:A5:38:FD:8F:A4:2E:A2:65:6C:86:52:BC:E0:6E:94:F2:9F:7C:4D:B5:DF:AF:AA:6F:44:90:8D:F4\r\n' +
'a=setup:actpass\r\n' +
'a=rtcp-mux\r\n' +
'a=mid:mid1\r\n' +
'a=sendonly\r\n' +
'a=msid:stream1 track1\r\n' +
'a=ssrc:1001 cname:some\r\n' +
'a=rtpmap:111 opus/48000/2\r\n';
test(function() {
var pc = new RTCPeerConnection();
assert_equals(pc.canTrickleIceCandidates, null, 'canTrickleIceCandidates property is null');
}, 'canTrickleIceCandidates property is null prior to setRemoteDescription');
promise_test(function() {
var pc = new RTCPeerConnection();
return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp}))
.then(function() {
assert_true(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is true after setRemoteDescription');
})
}, 'canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle');
promise_test(function() {
var pc = new RTCPeerConnection();
return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.replace('a=ice-options:trickle\r\n', '')}))
.then(function() {
assert_false(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is false after setRemoteDescription');
})
}, 'canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle');
</script>
</body>
</html>

View file

@ -0,0 +1,29 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RTCPeerConnection ICEGatheringState tests</title>
</head>
<body>
<!-- These files are in place when executing on W3C. -->
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
async_test(function(test) {
var pc = new RTCPeerConnection(null);
pc.onicegatheringstatechange = test.step_func(function(event) {
if (pc.iceGatheringState === 'complete') {
test.done();
}
});
pc.createOffer({offerToReceiveAudio: 1})
.then(offer => pc.setLocalDescription(offer))
.catch(test.step_func(function(e) {
assert_unreached('Error ' + e.name + ': ' + e.message);
}));
}, 'Tests that the ICE gathering state ends up as "completed" after applying a local offer.');
</script>
</body>
</html>

View file

@ -0,0 +1,35 @@
<!doctype html>
<html>
<head>
<title>This test checks that RTCConfiguration.iceCandidatePoolSize is set</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
function testValidPoolSize(size, expectedSize)
{
test(function() {
var pc = new RTCPeerConnection({iceCandidatePoolSize: size})
assert_equals(pc.getConfiguration().iceCandidatePoolSize, expectedSize !== undefined ? expectedSize : size)
}, "Setting iceCandidatePoolSize to a valid value: " + size)
}
function testInvalidPoolSize(size)
{
test(function() {
assert_throws(new TypeError(), () => new RTCPeerConnection({iceCandidatePoolSize: size}))
}, "Setting iceCandidatePoolSize to an invalid value: " + size)
}
testValidPoolSize(10)
testValidPoolSize(0)
testValidPoolSize(null, 0)
testValidPoolSize(undefined, 0)
testInvalidPoolSize(-1)
testInvalidPoolSize(1000)
testInvalidPoolSize("string")
</script>
</body>
</html>

View file

@ -0,0 +1,53 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RTCPeerConnection setRemoteDescription tests</title>
</head>
<body>
<!-- These files are in place when executing on W3C. -->
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
// tests that ontrack is called and parses the msid information from the SDP and creates
// the streams and tracks with matching identifiers.
async_test(function(test) {
const sdp = 'v=0\r\n' +
'o=- 166855176514521964 2 IN IP4 127.0.0.1\r\n' +
's=-\r\n' +
't=0 0\r\n' +
'a=msid-semantic:WMS *\r\n' +
'm=audio 9 UDP/TLS/RTP/SAVPF 111\r\n' +
'c=IN IP4 0.0.0.0\r\n' +
'a=rtcp:9 IN IP4 0.0.0.0\r\n' +
'a=ice-ufrag:someufrag\r\n' +
'a=ice-pwd:somelongpwdwithenoughrandomness\r\n' +
'a=fingerprint:sha-256 8C:71:B3:8D:A5:38:FD:8F:A4:2E:A2:65:6C:86:52:BC:E0:6E:94:F2:9F:7C:4D:B5:DF:AF:AA:6F:44:90:8D:F4\r\n' +
'a=setup:actpass\r\n' +
'a=rtcp-mux\r\n' +
'a=mid:mid1\r\n' +
'a=sendonly\r\n' +
'a=rtpmap:111 opus/48000/2\r\n' +
'a=msid:stream1 track1\r\n' +
'a=ssrc:1001 cname:some\r\n';
var pc = new RTCPeerConnection(null);
pc.ontrack = test.step_func(function(event) {
assert_equals(event.track.kind, 'audio', 'ontrack fires with an audio track');
assert_equals(event.track.id, 'track1', 'the track name is parsed from the MSID line');
assert_equals(event.streams.length, 1, 'the track belongs to one MediaStream');
assert_equals(event.streams[0].id, 'stream1', 'the stream name is parsed from the MSID line');
test.done();
});
pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp}))
.catch(test.step_func(function(e) {
assert_unreached('Error ' + e.name + ': ' + e.message);
}));
}, 'Triggers ontrack when called with a remote description and the MSID is parsed.');
</script>
</body>
</html>

View file

@ -47,7 +47,9 @@ property to true in Firefox.
function getUserMediaOkCallback(localStream) {
gFirstConnection = new RTCPeerConnection(null);
gFirstConnection.onicecandidate = onIceCandidateToFirst;
gFirstConnection.addStream(localStream);
localStream.getTracks().forEach(function(track) {
gFirstConnection.addTrack(track, localStream);
});
gFirstConnection.createOffer(onOfferCreated, failed('createOffer'));
var videoTag = document.getElementById('local-view');
@ -65,7 +67,7 @@ property to true in Firefox.
function receiveCall(offerSdp) {
gSecondConnection = new RTCPeerConnection(null);
gSecondConnection.onicecandidate = onIceCandidateToSecond;
gSecondConnection.onaddstream = onRemoteStream;
gSecondConnection.ontrack = onRemoteTrack;
var parsedOffer = new RTCSessionDescription({ type: 'offer',
sdp: offerSdp });
@ -97,9 +99,11 @@ property to true in Firefox.
gFirstConnection.addIceCandidate(event.candidate);
});
var onRemoteStream = test.step_func(function(event) {
var onRemoteTrack = test.step_func(function(event) {
var videoTag = document.getElementById('remote-view');
videoTag.srcObject = event.stream;
if (!videoTag.srcObject) {
videoTag.srcObject = event.streams[0];
}
});
// Returns a suitable error callback.