blob: e21f127252a3ad9f9555cf9f44e7d27e4b5fcbbd [file] [log] [blame]
This is a testharness.js-based test.
Found 75 tests; 32 PASS, 43 FAIL, 0 TIMEOUT, 0 NOTRUN.
FAIL new RTCPeerConnection() should have default configuration.iceServers of undefined assert_equals: expected (undefined) undefined but got (object) []
PASS new RTCPeerConnection(config) - {} should succeed
PASS setConfiguration(config) - {} should succeed
PASS new RTCPeerConnection(config) - { iceServers: null } should throw TypeError
PASS setConfiguration(config) - { iceServers: null } should throw TypeError
FAIL new RTCPeerConnection(config) - { iceServers: undefined } should succeed assert_equals: expected (undefined) undefined but got (object) []
FAIL setConfiguration(config) - { iceServers: undefined } should succeed assert_equals: expected (undefined) undefined but got (object) []
PASS new RTCPeerConnection(config) - { iceServers: [] } should succeed
PASS setConfiguration(config) - { iceServers: [] } should succeed
PASS new RTCPeerConnection(config) - { iceServers: [null] } should throw TypeError
PASS setConfiguration(config) - { iceServers: [null] } should throw TypeError
PASS new RTCPeerConnection(config) - { iceServers: [undefined] } should throw TypeError
PASS setConfiguration(config) - { iceServers: [undefined] } should throw TypeError
PASS new RTCPeerConnection(config) - { iceServers: [{}] } should throw TypeError
PASS setConfiguration(config) - { iceServers: [{}] } should throw TypeError
FAIL new RTCPeerConnection(config) - with stun server should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL setConfiguration(config) - with stun server should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL new RTCPeerConnection(config) - with stun server array should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL setConfiguration(config) - with stun server array should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL new RTCPeerConnection(config) - with 2 stun servers should succeed assert_equals: expected 1 but got 2
FAIL setConfiguration(config) - with 2 stun servers should succeed assert_equals: expected 1 but got 2
FAIL new RTCPeerConnection(config) - with turn server, username, credential should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL setConfiguration(config) - with turn server, username, credential should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL new RTCPeerConnection(config) - with turns server and empty string username, credential should succeed Failed to construct 'RTCPeerConnection': Failed to initialize native PeerConnection.
FAIL setConfiguration(config) - with turns server and empty string username, credential should succeed Failed to execute 'setConfiguration' on 'RTCPeerConnection': Could not update the PeerConnection with the given configuration.
FAIL new RTCPeerConnection(config) - with turn server and empty string username, credential should succeed Failed to construct 'RTCPeerConnection': Failed to initialize native PeerConnection.
FAIL setConfiguration(config) - with turn server and empty string username, credential should succeed Failed to execute 'setConfiguration' on 'RTCPeerConnection': Could not update the PeerConnection with the given configuration.
FAIL new RTCPeerConnection(config) - with one turns server, one turn server, username, credential should succeed assert_equals: expected 1 but got 2
FAIL setConfiguration(config) - with one turns server, one turn server, username, credential should succeed assert_equals: expected 1 but got 2
FAIL new RTCPeerConnection(config) - with stun server and credentialType password should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL setConfiguration(config) - with stun server and credentialType password should succeed assert_equals: expected (string) "password" but got (undefined) undefined
PASS new RTCPeerConnection(config) - with turn server and no credentials should throw InvalidAccessError
PASS setConfiguration(config) - with turn server and no credentials should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with turn server and only username should throw InvalidAccessError
PASS setConfiguration(config) - with turn server and only username should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with turn server and only credential should throw InvalidAccessError
PASS setConfiguration(config) - with turn server and only credential should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with turns server and no credentials should throw InvalidAccessError
PASS setConfiguration(config) - with turns server and no credentials should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with turns server and only username should throw InvalidAccessError
PASS setConfiguration(config) - with turns server and only username should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with turns server and only credential should throw InvalidAccessError
PASS setConfiguration(config) - with turns server and only credential should throw InvalidAccessError
PASS new RTCPeerConnection(config) - with "" url should throw SyntaxError
PASS setConfiguration(config) - with "" url should throw SyntaxError
PASS new RTCPeerConnection(config) - with ["stun:stun1.example.net", ""] url should throw SyntaxError
PASS setConfiguration(config) - with ["stun:stun1.example.net", ""] url should throw SyntaxError
PASS new RTCPeerConnection(config) - with relative url should throw SyntaxError
PASS setConfiguration(config) - with relative url should throw SyntaxError
PASS new RTCPeerConnection(config) - with http url should throw SyntaxError
PASS setConfiguration(config) - with http url should throw SyntaxError
FAIL new RTCPeerConnection(config) - with invalid turn url should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turn://example.org/foo?x=y'
}] })" threw object "InvalidAccessError: Failed to construct 'RTCPeerConnection': Both username and credential are required when the URL scheme is "turn" or "turns"." ("InvalidAccessError") expected object "SyntaxError" ("SyntaxError")
FAIL setConfiguration(config) - with invalid turn url should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turn://example.org/foo?x=y'
}] })" threw object "InvalidAccessError: Failed to execute 'setConfiguration' on 'RTCPeerConnection': Both username and credential are required when the URL scheme is "turn" or "turns"." ("InvalidAccessError") expected object "SyntaxError" ("SyntaxError")
FAIL new RTCPeerConnection(config) - with invalid stun url should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'stun://example.org/foo?x=y'
}] })" threw object "NotSupportedError: Failed to construct 'RTCPeerConnection': Failed to initialize native PeerConnection." ("NotSupportedError") expected object "SyntaxError" ("SyntaxError")
FAIL setConfiguration(config) - with invalid stun url should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'stun://example.org/foo?x=y'
}] })" threw object "OperationError: Failed to execute 'setConfiguration' on 'RTCPeerConnection': Could not update the PeerConnection with the given configuration." ("OperationError") expected object "SyntaxError" ("SyntaxError")
FAIL new RTCPeerConnection(config) - with empty urls should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: []
}] })" did not throw
FAIL setConfiguration(config) - with empty urls should throw SyntaxError assert_throws: function "() =>
makePc({ iceServers: [{
urls: []
}] })" did not throw
FAIL new RTCPeerConnection(config) - with invalid credentialType should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
urls: [],
credentialType: 'invalid'
}] })" did not throw
FAIL setConfiguration(config) - with invalid credentialType should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
urls: [],
credentialType: 'invalid'
}] })" did not throw
FAIL new RTCPeerConnection(config) - with credentialType token should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
urls: [],
credentialType: 'token'
}] })" did not throw
FAIL setConfiguration(config) - with credentialType token should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
urls: [],
credentialType: 'token'
}] })" did not throw
FAIL new RTCPeerConnection(config) - with url field should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
url: 'stun:stun1.example.net'
}] })" did not throw
FAIL setConfiguration(config) - with url field should throw TypeError assert_throws: function "() =>
makePc({ iceServers: [{
url: 'stun:stun1.example.net'
}] })" did not throw
FAIL new RTCPeerConnection(config) - with turns server, credentialType password, and RTCOauthCredential credential should throw InvalidAccessError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turns:turn.example.org',
credentialType: 'password',
username: 'user',
credential: {
macKey: '',
accessToken: ''
}
}] })" did not throw
FAIL setConfiguration(config) - with turns server, credentialType password, and RTCOauthCredential credential should throw InvalidAccessError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turns:turn.example.org',
credentialType: 'password',
username: 'user',
credential: {
macKey: '',
accessToken: ''
}
}] })" did not throw
FAIL new RTCPeerConnection(config) - with turns server, credentialType oauth, and string credential should throw InvalidAccessError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turns:turn.example.org',
credentialType: 'oauth',
username: 'user',
credential: 'cred'
}] })" did not throw
FAIL setConfiguration(config) - with turns server, credentialType oauth, and string credential should throw InvalidAccessError assert_throws: function "() =>
makePc({ iceServers: [{
urls: 'turns:turn.example.org',
credentialType: 'oauth',
username: 'user',
credential: 'cred'
}] })" did not throw
FAIL new RTCPeerConnection(config) - with turns server, credentialType oauth and RTCOAuthCredential credential should succeed assert_equals: expected (string) "oauth" but got (undefined) undefined
FAIL setConfiguration(config) - with turns server, credentialType oauth and RTCOAuthCredential credential should succeed assert_equals: expected (string) "oauth" but got (undefined) undefined
FAIL new RTCPeerConnection(config) - with both turns and stun server, credentialType oauth and RTCOAuthCredential credential should succeed assert_equals: expected 1 but got 2
FAIL setConfiguration(config) - with both turns and stun server, credentialType oauth and RTCOAuthCredential credential should succeed assert_equals: expected 1 but got 2
FAIL new RTCPeerConnection(config) - with stun server, credentialType oauth, and string credential should succeed assert_equals: expected (string) "oauth" but got (undefined) undefined
FAIL setConfiguration(config) - with stun server, credentialType oauth, and string credential should succeed assert_equals: expected (string) "oauth" but got (undefined) undefined
FAIL new RTCPeerConnection(config) - with stun server, credentialType password, and RTCOAuthCredential credential should succeed assert_equals: expected (string) "password" but got (undefined) undefined
FAIL setConfiguration(config) - with stun server, credentialType password, and RTCOAuthCredential credential should succeed assert_equals: expected (string) "password" but got (undefined) undefined
Harness: the test ran to completion.