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

Side by Side Diff: content/test/data/media/image_capture_test.html

Issue 2197143002: Revert of ImageCapture: content_browsertest WebRtcImageCaptureBrowserTest CreateAndGetCapabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/webrtc_content_browsertest_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <!-- Image Capture Browser Test -->
5 </head>
6 <body>
7 <script type="text/javascript" src="webrtc_test_utilities.js"></script>
8 <script>
9
10 // Runs an ImageCapture.getPhotoCapabilities().
11 function testCreateAndGetCapabilities() {
12 var hasVideoInputDevice = false;
13 navigator.mediaDevices.enumerateDevices()
14 .then(devices => {
15 devices.forEach(function(device) {
16 if (device.kind === "videoinput")
17 hasVideoInputDevice = true;
18 });
19
20 if (!hasVideoInputDevice)
21 return Promise.reject("no video devices");
22 })
23 .catch(err => {
24 return failTest('Error enumerating devices: ' + err.toString());
25 });
26
27 navigator.mediaDevices.getUserMedia({"video" : true})
28 .then(stream => {
29 assertEquals('video', stream.getVideoTracks()[0].kind);
30 return new ImageCapture(stream.getVideoTracks()[0]);
31 })
32 .then(capturer => {
33 return capturer.getPhotoCapabilities();
34 })
35 .then(capabilities => {
36 assertNotEquals(0, capabilities.imageHeight.min);
37 assertNotEquals(0, capabilities.imageHeight.current);
38 assertNotEquals(0, capabilities.imageHeight.max);
39 assertNotEquals(0, capabilities.imageWidth.min);
40 assertNotEquals(0, capabilities.imageWidth.current);
41 assertNotEquals(0, capabilities.imageWidth.max);
42 assertNotEquals(0, capabilities.zoom.min);
43 assertNotEquals(0, capabilities.zoom.current);
44 assertNotEquals(0, capabilities.zoom.max);
45
46 reportTestSuccess();
47 })
48 .catch(err => {
49 return failTest(err.toString());
50 });
51 }
52
53 </script>
54 </body>
55 </html>
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/webrtc_content_browsertest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698