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

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: Review comments 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 PUBLIC "-//IETF//DTD HTML//EN">
Peter Beverloo 2015/06/26 12:36:55 micro nit: could use the modern doctype: <!DOCTYP
hta - Chromium 2015/06/26 13:28:55 Done.
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
Peter Beverloo 2015/06/26 12:36:55 micro nit: description/console aren't necessary fo
hta - Chromium 2015/06/26 13:28:55 Done.
9 <div id="console"></div>
10 <script>
11
12 promise_test(function() {
13 assert_idl_attribute(navigator, 'mediaDevices');
14 assert_idl_attribute(navigator.mediaDevices, 'getUserMedia');
15
16 return navigator.mediaDevices.getUserMedia({audio: true}).then(function(s) {
17 assert_equals(s.getTracks().length, 1);
18 });
19 }, 'getUserMedia() audio track');
20
21 promise_test(function() {
22 assert_idl_attribute(navigator, 'mediaDevices');
23 assert_idl_attribute(navigator.mediaDevices, 'getUserMedia');
24
25 return navigator.mediaDevices.getUserMedia({audio: true, video:true})
26 .then(function(s) {
27 assert_equals(s.getTracks().length, 2);
28 assert_equals(s.getAudioTracks().length, 1);
29 assert_equals(s.getVideoTracks().length, 1);
30 });
31 }, 'getUserMedia() audio and video tracks');
32
33 promise_test(function() {
34 return navigator.mediaDevices.getUserMedia(
35 {audio: {'mandatory': { 'valid_but_unsupported_1': 0}}})
36 .then(function(s) {
37 fail('getUserMedia should have failed');
38 }).catch(function(e) {
39 assert_equals(e.name, 'ConstraintNotSatisfiedError');
40 });
41 }, 'getUserMedia() with unsupported mandatory constraint');
42
43
44 </script>
45 </body>
46 </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