trivial constraint for getusermedia
authorDominique Hazael-Massieux <dom@w3.org>
Mon, 03 Jun 2013 18:06:29 +0200
changeset 58 51bcea17cfc2
parent 57 405a1260a758
child 59 0fbe5befb18a
trivial constraint for getusermedia
submitted/W3C/getusermedia-trivial-constraint.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/submitted/W3C/getusermedia-trivial-constraint.html	Mon Jun 03 18:06:29 2013 +0200
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+<head>
+<title>Trivial mandatory constraint in getUserMedia</title>
+<link rel="author" title="Dominique Hazael-Massieux" href="mailto:[email protected]"/>
+<link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia">
+<link rel='stylesheet' href='/resources/testharness.css' media='all'/>
+</head>
+<body>
+<p>When prompted, accept to share your video stream.</p>
+<h1>Description</h1>
+<p>This test checks that setting a trivial mandatory constraint (width &gt;=0) in getUserMedia works</p>
+
+<div id='log'></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=featuredetection.js></script>
+<script src=prefix.js></script>
+<script>
+var t = async_test("Tests that setting a trivial mandatory constraint in getUserMedia works");
+t.step(function() {
+  navigator.getUserMedia({video: {mandatory: {width: {min:0}}}}, t.step_func(function (stream) {
+    assert_equals(stream.getVideoTracks().length, 1, "the media stream has exactly one video track");
+    t.done();
+  }), function(error) {});
+});
+</script>
+</body>
+</html>