Update web-platform-tests to revision 50ff4f970fd8592a9f436d4e86e7d572de143260

This commit is contained in:
WPT Sync Bot 2018-09-20 21:31:18 -04:00
parent 82bbf3ad45
commit 8ea5658199
150 changed files with 4737 additions and 998 deletions

View file

@ -53,6 +53,10 @@
assert_equals(pc.getConfiguration().iceServers, undefined);
}, 'new RTCPeerConnection() should have default configuration.iceServers of undefined');
config_test(makePc => {
makePc({});
}, '{} should succeed');
config_test(makePc => {
assert_throws(new TypeError(), () =>
makePc({ iceServers: null }));
@ -126,7 +130,7 @@
}, `with 2 stun servers should succeed`);
config_test(makePc => {
const pc = new RTCPeerConnection({ iceServers: [{
const pc = makePc({ iceServers: [{
urls: 'turn:turn.example.org',
username: 'user',
credential: 'cred'
@ -281,35 +285,49 @@
transport-ext = 1*unreserved
*/
config_test(makePc => {
assert_throws('SyntaxError', () =>
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: ''
}] }));
}, 'with "" url should throw SyntaxError');
config_test(makePc => {
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: ['stun:stun1.example.net', '']
}] }));
}, 'with ["stun:stun1.example.net", ""] url should throw SyntaxError');
config_test(makePc => {
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: 'relative-url'
}] }));
}, 'with relative url should throw SyntaxError');
config_test(makePc => {
assert_throws('SyntaxError', () =>
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: 'http://example.com'
}] }));
}, 'with http url should throw SyntaxError');
config_test(makePc => {
assert_throws('SyntaxError', () =>
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: 'turn://example.org/foo?x=y'
}] }));
}, 'with invalid turn url should throw SyntaxError');
config_test(makePc => {
assert_throws('SyntaxError', () =>
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: 'stun://example.org/foo?x=y'
}] }));
}, 'with invalid stun url should throw SyntaxError');
config_test(makePc => {
assert_throws('SyntaxError', () =>
assert_throws(new SyntaxError(), () =>
makePc({ iceServers: [{
urls: []
}] }));
@ -471,52 +489,6 @@
}, 'with stun server, credentialType password, and RTCOAuthCredential credential should succeed');
// credential type validation is ignored when urls is empty and there is no scheme name
config_test(makePc => {
const pc = makePc({ iceServers: [{
urls: [],
credentialType: 'oauth',
username: 'user',
credential: 'cred'
}] });
const { iceServers } = pc.getConfiguration();
assert_equals(iceServers.length, 1);
const server = iceServers[0];
assert_array_equals(server.urls, []);
assert_equals(server.credentialType, 'oauth');
assert_equals(server.username, 'user');
assert_equals(server.credential, 'cred');
}, 'with empty urls list, credentialType oauth, and string credential should succeed');
// credential type validation is ignored when urls is empty and there is no scheme name
config_test(makePc => {
const pc = makePc({ iceServers: [{
urls: [],
credentialType: 'password',
username: 'user',
credential: {
macKey: '',
accessToken: ''
}
}] });
const { iceServers } = pc.getConfiguration();
assert_equals(iceServers.length, 1);
const server = iceServers[0];
assert_array_equals(server.urls, []);
assert_equals(server.credentialType, 'password');
assert_equals(server.username, 'user');
const { credential } = server;
assert_equals(credential.macKey, '');
assert_equals(credential.accessToken, '');
}, 'with empty urls list, credentialType password, and RTCOAuthCredential credential should succeed');
/*
Tested
4.3.2. To set a configuration