| 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
|
| index 2ed74495c716b2719231972fbb6b1a7f142c1a4f..0dbd39b3cc7c594407fd447eccdd24c51fa7ad1a 100644
|
| --- a/content/test/data/media/image_capture_test.html
|
| +++ b/content/test/data/media/image_capture_test.html
|
| @@ -6,10 +6,12 @@ B<!DOCTYPE html>
|
| <body>
|
| <script type="text/javascript" src="webrtc_test_utilities.js"></script>
|
| <script>
|
| +const HEIGHT = 180;
|
| +const WIDTH = 320;
|
|
|
| // Runs an ImageCapture.getPhotoCapabilities().
|
| function testCreateAndGetCapabilities() {
|
| - const constraints = { mandatory: { maxHeight: 180, maxWidth: 320 } };
|
| + const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
|
| navigator.mediaDevices.getUserMedia({"video" : constraints})
|
| .then(stream => {
|
| assertEquals('video', stream.getVideoTracks()[0].kind);
|
| @@ -38,7 +40,7 @@ function testCreateAndGetCapabilities() {
|
|
|
| // Runs an ImageCapture.takePhoto().
|
| function testCreateAndTakePhoto() {
|
| - const constraints = { mandatory: { maxHeight: 180, maxWidth: 320 } };
|
| + const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
|
| navigator.mediaDevices.getUserMedia({"video" : constraints})
|
| .then(stream => {
|
| assertEquals('video', stream.getVideoTracks()[0].kind);
|
| @@ -58,6 +60,28 @@ function testCreateAndTakePhoto() {
|
| });
|
| }
|
|
|
| +// Runs an ImageCapture.grabFrame().
|
| +function testCreateAndGrabFrame() {
|
| + const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
|
| + navigator.mediaDevices.getUserMedia({"video" : constraints})
|
| + .then(stream => {
|
| + assertEquals('video', stream.getVideoTracks()[0].kind);
|
| + return new ImageCapture(stream.getVideoTracks()[0]);
|
| + })
|
| + .then(capturer => {
|
| + return capturer.grabFrame();
|
| + })
|
| + .then(imageBitmap => {
|
| + assertEquals(WIDTH, imageBitmap.width);
|
| + assertEquals(HEIGHT, imageBitmap.height);
|
| +
|
| + reportTestSuccess();
|
| + })
|
| + .catch(err => {
|
| + return failTest(err.toString());
|
| + });
|
| +}
|
| +
|
| </script>
|
| </body>
|
| </html>
|
|
|