philn@webkit.org | 13b9094 | 2014-11-12 08:25:05 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <script src="../../resources/js-test-pre.js"></script> |
| 5 | </head> |
| 6 | <body> |
| 7 | <script> |
| 8 | description("Tests UserMedia success callback using the mock service."); |
| 9 | window.jsTestIsAsync = true; |
| 10 | |
| 11 | if (window.testRunner) |
| 12 | testRunner.setUserMediaPermission(true); |
| 13 | else |
| 14 | debug('This test can not be run without the testRunner'); |
| 15 | |
| 16 | var options = {audio: true, video: true}; |
eric.carlson@apple.com | c147096 | 2017-02-09 17:29:58 +0000 | [diff] [blame] | 17 | navigator.mediaDevices.getUserMedia(options) |
| 18 | .then(stream => { |
| 19 | finishJSTest(); |
| 20 | }) |
| 21 | .catch(err => { |
| 22 | testFailed('Error callback invoked unexpectedly'); |
| 23 | finishJSTest(); |
| 24 | }); |
philn@webkit.org | 13b9094 | 2014-11-12 08:25:05 +0000 | [diff] [blame] | 25 | </script> |
| 26 | <script src="../../resources/js-test-post.js"></script> |
| 27 | </body> |
| 28 | </html> |