Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1357)

Unified Diff: content/test/data/media/image_capture_test.html

Issue 2456193004: Image Capture: enable content_browsertests in Linux/CrOs (Closed)
Patch Set: xianglu@ comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/webrtc/webrtc_image_capture_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0dbd39b3cc7c594407fd447eccdd24c51fa7ad1a..ec39281fbf0177e0f86e82d786f50570836549c8 100644
--- a/content/test/data/media/image_capture_test.html
+++ b/content/test/data/media/image_capture_test.html
@@ -6,13 +6,12 @@ B<!DOCTYPE html>
<body>
<script type="text/javascript" src="webrtc_test_utilities.js"></script>
<script>
-const HEIGHT = 180;
const WIDTH = 320;
+/** @const */ var CONSTRAINTS = { width: { max : WIDTH } };
// Runs an ImageCapture.getPhotoCapabilities().
function testCreateAndGetCapabilities() {
- const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
- navigator.mediaDevices.getUserMedia({"video" : constraints})
+ navigator.mediaDevices.getUserMedia({"video" : CONSTRAINTS})
.then(stream => {
assertEquals('video', stream.getVideoTracks()[0].kind);
return new ImageCapture(stream.getVideoTracks()[0]);
@@ -21,16 +20,7 @@ function testCreateAndGetCapabilities() {
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);
-
+ // There's nothing to check here since |capabilities| vary per device.
reportTestSuccess();
})
.catch(err => {
@@ -40,8 +30,7 @@ function testCreateAndGetCapabilities() {
// Runs an ImageCapture.takePhoto().
function testCreateAndTakePhoto() {
- const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
- navigator.mediaDevices.getUserMedia({"video" : constraints})
+ navigator.mediaDevices.getUserMedia({"video" : CONSTRAINTS})
.then(stream => {
assertEquals('video', stream.getVideoTracks()[0].kind);
return new ImageCapture(stream.getVideoTracks()[0]);
@@ -62,8 +51,7 @@ function testCreateAndTakePhoto() {
// Runs an ImageCapture.grabFrame().
function testCreateAndGrabFrame() {
- const constraints = { mandatory: { maxHeight: HEIGHT, maxWidth: WIDTH } };
- navigator.mediaDevices.getUserMedia({"video" : constraints})
+ navigator.mediaDevices.getUserMedia({"video" : CONSTRAINTS})
.then(stream => {
assertEquals('video', stream.getVideoTracks()[0].kind);
return new ImageCapture(stream.getVideoTracks()[0]);
@@ -73,7 +61,6 @@ function testCreateAndGrabFrame() {
})
.then(imageBitmap => {
assertEquals(WIDTH, imageBitmap.width);
- assertEquals(HEIGHT, imageBitmap.height);
reportTestSuccess();
})
« no previous file with comments | « content/browser/webrtc/webrtc_image_capture_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698