blob: 9da9cc87b5237f63da30b32cc95c042992261f31 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
var captureDevices;
var captureDevice;
description("Tests MediaDevices.enumerateDevices()");
window.jsTestIsAsync = true;
shouldBeType("navigator.mediaDevices", "Object");
shouldBeType("navigator.mediaDevices.enumerateDevices", "Function");
debug("");
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
captureDevices = devices;
shouldBeNonZero("captureDevices.length");
debug("");
devices.forEach(function(device) {
captureDevice = device;
shouldBeNonNull("captureDevice.kind");
shouldBeNonNull("captureDevice.deviceId");
shouldBeNonNull("captureDevice.label");
shouldBeNonNull("captureDevice.groupId");
debug("");
});
finishJSTest();
})
.catch(function(err) {
testFailed(err.name + ": " + err.message);
});
window.successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>