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

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

Issue 2190523004: ImageCapture: content_browsertest WebRtcImageCaptureBrowserTest CreateAndGetCapabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test entry for real-world capture device, leaving just FakeVCD Created 4 years, 5 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/content_tests.gypi ('k') | content/test/webrtc_content_browsertest_base.h » ('j') | 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
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>
« 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