blob: 4a4f8ed8acd4c78df5f6ee798c5e779d636bc935 [file] [log] [blame]
<!DOCTYPE HTML>
<title>mediaDevices.getSupportedConstraints</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
// Tests that getSupportedConstraints() returns what it should.
test(function() {
supported_constraints = navigator.mediaDevices.getSupportedConstraints();
assert_true(supported_constraints.width);
assert_true(supported_constraints.height);
assert_true(supported_constraints.aspectRatio);
assert_true(supported_constraints.frameRate);
assert_true(supported_constraints.facingMode);
assert_true(supported_constraints.resizeMode);
assert_true(supported_constraints.volume);
assert_true(supported_constraints.sampleRate);
assert_true(supported_constraints.sampleSize);
assert_true(supported_constraints.echoCancellation);
assert_true(supported_constraints.autoGainControl);
assert_true(supported_constraints.noiseSuppression);
assert_true(supported_constraints.latency);
assert_true(supported_constraints.channelCount);
assert_true(supported_constraints.deviceId);
assert_true(supported_constraints.groupId);
// All non-supported values are "undefined".
assert_true(supported_constraints.nonsense === undefined);
}, 'Supported constraints returns good data');
</script>