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