Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e

This commit is contained in:
Ms2ger 2016-12-28 09:51:21 +01:00
parent 81ca858678
commit d6ba94ca28
2339 changed files with 89274 additions and 9328 deletions

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>RTCDataChannelEvent constructor</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_equals(RTCDataChannelEvent.length, 2);
assert_throws(
new TypeError(),
function() { new RTCDataChannelEvent('type'); }
);
}, 'RTCDataChannelEvent constructor without a required argument.');
test(function() {
assert_throws(
new TypeError(),
function() { new RTCDataChannelEvent('type', { channel: null }); }
);
}, 'RTCDataChannelEvent constructor with channel passed as null.');
test(function() {
assert_throws(
new TypeError(),
function() { new RTCDataChannelEvent('type', { channel: undefined }); }
);
}, 'RTCDataChannelEvent constructor with a channel passed as undefined.');
test(function() {
var pc = new RTCPeerConnection();
var c = pc.createDataChannel('');
var e = new RTCDataChannelEvent('type', { channel: c });
assert_true(e instanceof RTCDataChannelEvent);
assert_equals(e.channel, c);
}, 'RTCDataChannelEvent constructor with full arguments.');
</script>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>RTCPeerConnectionIceEvent constructor</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_equals(RTCPeerConnectionIceEvent.length, 1);
var e = new RTCPeerConnectionIceEvent('type');
assert_equals(e.candidate, null);
assert_false(e.bubbles);
assert_false(e.cancelable);
}, 'RTCPeerConnectionIceEvent constructor with no candidate provided.');
test(function() {
var e = new RTCPeerConnectionIceEvent('type', { candidate: null });
assert_equals(e.candidate, null);
}, 'RTCPeerConnectionIceEvent constructor with candidate passed as null.');
test(function() {
var e = new RTCPeerConnectionIceEvent('type', { candidate: undefined });
assert_equals(e.candidate, null);
}, 'RTCPeerConnectionIceEvent constructor with candidate passed as undefined.');
test(function() {
var c = new RTCIceCandidate({ candidate: 'candidate', sdpMid: 'sdpMid', sdpMLineIndex: 1 });
var e = new RTCPeerConnectionIceEvent('type', { candidate: c, url: 'url', bubbles: true, cancelable: true});
assert_equals(e.type, 'type');
assert_equals(e.candidate, c);
// assert_equals(e.url, 'url');
assert_true(e.bubbles);
assert_true(e.cancelable);
}, 'RTCPeerConnectionIceEvent constructor with full arguments.');
</script>

View file

@ -36,6 +36,14 @@ property to true in Firefox.
var gFirstConnection = null;
var gSecondConnection = null;
// if the remote video gets video data that implies the negotiation
// as well as the ICE and DTLS connection are up.
document.getElementById('remote-view')
.addEventListener('loadedmetadata', function() {
// Call negotiated: done.
test.done();
});
function getUserMediaOkCallback(localStream) {
gFirstConnection = new RTCPeerConnection(null);
gFirstConnection.onicecandidate = onIceCandidateToFirst;
@ -78,22 +86,15 @@ property to true in Firefox.
var parsedAnswer = new RTCSessionDescription({ type: 'answer',
sdp: answerSdp });
gFirstConnection.setRemoteDescription(parsedAnswer);
// Call negotiated: done.
test.done();
};
var onIceCandidateToFirst = test.step_func(function(event) {
// If event.candidate is null = no more candidates.
if (event.candidate) {
gSecondConnection.addIceCandidate(event.candidate);
}
gSecondConnection.addIceCandidate(event.candidate);
});
var onIceCandidateToSecond = test.step_func(function(event) {
if (event.candidate) {
gFirstConnection.addIceCandidate(event.candidate);
}
gFirstConnection.addIceCandidate(event.candidate);
});
var onRemoteStream = test.step_func(function(event) {