OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>getUserMedia() triggers error callback when auth is denied</title> |
| 5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/> |
| 6 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
error-names"> |
| 7 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
idl-def-MediaStreamError"> |
| 8 </head> |
| 9 <body> |
| 10 <p class="instructions" style="display:none">When prompted, <strong>please deny<
/strong> access to |
| 11 the video stream.</p> |
| 12 <h1 class="instructions" style="display:none">Description</h1> |
| 13 <p class="instructions" style="display:none">This test checks that the error cal
lback is triggered |
| 14 when user denies access to the video stream.</p> |
| 15 |
| 16 <div id='log'></div> |
| 17 <script src=../../../resources/testharness.js></script> |
| 18 <script src=../../../resources/testharnessreport.js></script> |
| 19 <script src="../../../resources/vendor-prefix.js" data-prefixed-objects='[{"ance
stors":["navigator"], "name":"getUserMedia"}]'></script> |
| 20 <script> |
| 21 var t = async_test("Tests that the error callback is triggered when permission i
s denied", {timeout:10000}); |
| 22 t.step(function() { |
| 23 navigator.getUserMedia( |
| 24 {video: true}, |
| 25 t.step_func(function (stream) { |
| 26 assert_unreached("The success callback should not be triggered since acces
s is to be denied"); |
| 27 t.done(); |
| 28 }), |
| 29 t.step_func(function (error) { |
| 30 assert_equals(error.name, "securityError", "securityError returned"); |
| 31 assert_equals(error.constraintName, undefined, "constraintName attribute n
ot set for permission denied"); |
| 32 t.done(); |
| 33 }) |
| 34 ); |
| 35 }); |
| 36 </script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |