| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description("Tests UserMedia error callback using the mock service."); |
| window.jsTestIsAsync = true; |
| |
| if (window.testRunner) |
| testRunner.setUserMediaPermission(false); |
| else |
| debug('This test can not be run without the testRunner'); |
| |
| var error; |
| var options = {audio:false, video:true}; |
| navigator.mediaDevices.getUserMedia(options) |
| .then(stream => { |
| testFailed('Success callback invoked unexpectedly'); |
| finishJSTest(); |
| }) |
| .catch(err => { |
| error = err; |
| shouldBeEqualToString('error.name', 'NotAllowedError'); |
| finishJSTest(); |
| }); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |