mirror of
https://github.com/servo/servo.git
synced 2025-09-13 00:18:22 +01:00
Update web-platform-tests to revision 1829a42c93e435937db68c8a842fa9b56dd39dc2
This commit is contained in:
parent
9f142b9c22
commit
46e1e26950
72 changed files with 1286 additions and 1091 deletions
|
@ -64,6 +64,34 @@ promise_test(t => {
|
|||
}
|
||||
}));
|
||||
}, 'groupId is correctly supported by getUserMedia() for video devices');
|
||||
|
||||
promise_test(t => {
|
||||
return navigator.mediaDevices.enumerateDevices()
|
||||
.then(t.step_func(async devices => {
|
||||
for (var i in devices) {
|
||||
await navigator.mediaDevices.getUserMedia(
|
||||
{audio: {groupId: {exact: devices[i].groupId}}})
|
||||
.then(
|
||||
t.step_func(stream => {
|
||||
var found_device = devices.find(element => {
|
||||
return element.deviceId ==
|
||||
stream.getTracks()[0].getSettings().deviceId;
|
||||
});
|
||||
assert_true(undefined !== found_device);
|
||||
assert_equals(found_device.kind, "audioinput");
|
||||
assert_equals(found_device.groupId, devices[i].groupId);
|
||||
}),
|
||||
t.step_func(error => {
|
||||
assert_equals(error.name, "OverconstrainedError");
|
||||
assert_equals(error.constraint, "groupId");
|
||||
var found_device = devices.find(element => {
|
||||
return element.kind == "audioinput" &&
|
||||
element.groupId == devices[i].groupId});
|
||||
assert_true(undefined === found_device);
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}, 'groupId is correctly supported by getUserMedia() for audio devices');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue