properly deal with error callback
authorDominique Hazael-Massieux <dom@w3.org>
Mon, 03 Jun 2013 18:18:48 +0200
changeset 61 b3dfdf7687e6
parent 60 9d9159f89306
child 62 801d1521d150
properly deal with error callback
submitted/W3C/getusermedia-impossible-constraint.html
--- a/submitted/W3C/getusermedia-impossible-constraint.html	Mon Jun 03 18:18:14 2013 +0200
+++ b/submitted/W3C/getusermedia-impossible-constraint.html	Mon Jun 03 18:18:48 2013 +0200
@@ -22,11 +22,12 @@
   navigator.getUserMedia({video: {mandatory: {width: {min:Infinity}}}}, t.step_func(function (stream) {
     assert_unreached("a Video stream of infinite width cannot be created");
     t.done();
-  }), function(error) {
-    assert_equals(error.name, "ContraintNotSatisfied");
-    assert_equals(error.constraintName, "width");
+  }), t.step_func(function(error) {
+    console.log(error);
+    assert_equals(error.name, "ContraintNotSatisfied", "An impossible constraint triggers a ContraintNotSatified error");
+    assert_equals(error.constraintName, "width", "The name of the not satisfied error is given in error.constraintName");
     t.done();
-  });
+  }));
 });
 </script>
 </body>