| Index: content/test/data/media/image_capture_test.html
|
| diff --git a/content/test/data/media/image_capture_test.html b/content/test/data/media/image_capture_test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6b8b6461ccef696d6ab651dbdd94aab8736cca93
|
| --- /dev/null
|
| +++ b/content/test/data/media/image_capture_test.html
|
| @@ -0,0 +1,55 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<!-- Image Capture Browser Test -->
|
| +</head>
|
| +<body>
|
| +<script type="text/javascript" src="webrtc_test_utilities.js"></script>
|
| +<script>
|
| +
|
| +// Runs an ImageCapture.getPhotoCapabilities().
|
| +function testCreateAndGetCapabilities() {
|
| + var hasVideoInputDevice = false;
|
| + navigator.mediaDevices.enumerateDevices()
|
| + .then(devices => {
|
| + devices.forEach(function(device) {
|
| + if (device.kind === "videoinput")
|
| + hasVideoInputDevice = true;
|
| + });
|
| +
|
| + if (!hasVideoInputDevice)
|
| + return Promise.reject("no video devices");
|
| + })
|
| + .catch(err => {
|
| + return failTest('Error enumerating devices: ' + err.toString());
|
| + });
|
| +
|
| + navigator.mediaDevices.getUserMedia({"video" : true})
|
| + .then(stream => {
|
| + assertEquals('video', stream.getVideoTracks()[0].kind);
|
| + return new ImageCapture(stream.getVideoTracks()[0]);
|
| + })
|
| + .then(capturer => {
|
| + return capturer.getPhotoCapabilities();
|
| + })
|
| + .then(capabilities => {
|
| + assertNotEquals(0, capabilities.imageHeight.min);
|
| + assertNotEquals(0, capabilities.imageHeight.current);
|
| + assertNotEquals(0, capabilities.imageHeight.max);
|
| + assertNotEquals(0, capabilities.imageWidth.min);
|
| + assertNotEquals(0, capabilities.imageWidth.current);
|
| + assertNotEquals(0, capabilities.imageWidth.max);
|
| + assertNotEquals(0, capabilities.zoom.min);
|
| + assertNotEquals(0, capabilities.zoom.current);
|
| + assertNotEquals(0, capabilities.zoom.max);
|
| +
|
| + reportTestSuccess();
|
| + })
|
| + .catch(err => {
|
| + return failTest(err.toString());
|
| + });
|
| +}
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|