mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
36 lines
1003 B
HTML
36 lines
1003 B
HTML
<!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>
|