Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: LayoutTests/fast/mediastream/getusermedia-promise.html

Issue 1202553002: Implement navigator.mediaDevices.getUserMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: HTML style issues in test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/mediastream/MediaDevices.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9
10 promise_test(function() {
11 assert_idl_attribute(navigator, 'mediaDevices');
12 assert_idl_attribute(navigator.mediaDevices, 'getUserMedia');
13
14 return navigator.mediaDevices.getUserMedia({audio: true}).then(function(s) {
15 assert_equals(s.getTracks().length, 1);
16 });
17 }, 'getUserMedia() audio track');
18
19 promise_test(function() {
20 assert_idl_attribute(navigator, 'mediaDevices');
21 assert_idl_attribute(navigator.mediaDevices, 'getUserMedia');
22
23 return navigator.mediaDevices.getUserMedia({audio: true, video:true})
24 .then(function(s) {
25 assert_equals(s.getTracks().length, 2);
26 assert_equals(s.getAudioTracks().length, 1);
27 assert_equals(s.getVideoTracks().length, 1);
28 });
29 }, 'getUserMedia() audio and video tracks');
30
31 promise_test(function() {
32 return navigator.mediaDevices.getUserMedia(
33 {audio: {'mandatory': { 'valid_but_unsupported_1': 0}}})
34 .then(function(s) {
35 fail('getUserMedia should have failed');
36 }).catch(function(e) {
37 assert_equals(e.name, 'ConstraintNotSatisfiedError');
38 });
39 }, 'getUserMedia() with unsupported mandatory constraint');
40
41
42 </script>
43 </body>
44 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/mediastream/MediaDevices.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698