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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html

Issue 2645613005: MediaStreamTrack: Add echo-cancellation and device-id to getSettings (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 5
6 promise_test(function() { 6 promise_test(function() {
7 return navigator.mediaDevices.getUserMedia({audio: true}) 7 return navigator.mediaDevices.getUserMedia({audio: true})
8 .then(function(s) { 8 .then(function(s) {
9 settings = s.getAudioTracks()[0].getSettings(); 9 settings = s.getAudioTracks()[0].getSettings();
10 assert_greater_than(Object.keys(settings).length, 0); 10 assert_greater_than(Object.keys(settings).length, 0);
11 }); 11 });
12 }, 'An audio track returns settings'); 12 }, 'An audio track returns settings');
13 13
14 promise_test(function() { 14 promise_test(function() {
15 return navigator.mediaDevices.getUserMedia({video: true}) 15 return navigator.mediaDevices.getUserMedia({video: true})
16 .then(function(s) { 16 .then(function(s) {
17 settings = s.getVideoTracks()[0].getSettings(); 17 settings = s.getVideoTracks()[0].getSettings();
18 assert_greater_than(Object.keys(settings).length, 0); 18 assert_greater_than(Object.keys(settings).length, 0);
19 }); 19 });
20 }, 'A video track returns settings'); 20 }, 'A video track returns settings');
21 21
22 promise_test(function() { 22 promise_test(function() {
23 return navigator.mediaDevices.getUserMedia({audio: true})
24 .then(function(s) {
25 settings = s.getAudioTracks()[0].getSettings();
26 assert_greater_than(Object.keys(settings).length, 0);
27 assert_true('deviceId' in settings,
28 'Device ID missing: ' + JSON.stringify(settings));
29 assert_true('echoCancellation' in settings,
30 'echoCancellation missing: ' + JSON.stringify(settings));
31 });
32 }, 'An audio track returns the expected variables');
33
34 promise_test(function() {
23 return navigator.mediaDevices.getUserMedia({video: true}) 35 return navigator.mediaDevices.getUserMedia({video: true})
24 .then(function(s) { 36 .then(function(s) {
25 settings = s.getVideoTracks()[0].getSettings(); 37 settings = s.getVideoTracks()[0].getSettings();
26 assert_greater_than(Object.keys(settings).length, 0); 38 assert_greater_than(Object.keys(settings).length, 0);
39 assert_true('deviceId' in settings,
40 'Device ID missing: ' + JSON.stringify(settings));
27 assert_true('frameRate' in settings, 41 assert_true('frameRate' in settings,
28 'Frame rate missing: ' + JSON.stringify(settings)); 42 'Frame rate missing: ' + JSON.stringify(settings));
29 assert_true('width' in settings, 43 assert_true('width' in settings,
30 'Width missing: ' + JSON.stringify(settings)); 44 'Width missing: ' + JSON.stringify(settings));
31 assert_true('height' in settings, 45 assert_true('height' in settings,
32 'Height missing: ' + JSON.stringify(settings)); 46 'Height missing: ' + JSON.stringify(settings));
33 }); 47 });
34 }, 'A video track returns frame rate'); 48 }, 'A video track returns the expected variables');
35 49
50 promise_test(function() {
51 return navigator.mediaDevices.getUserMedia({audio: true, video: true})
52 .then(function(s) {
53 videoSettings = s.getVideoTracks()[0].getSettings();
54 audioSettings = s.getAudioTracks()[0].getSettings();
55 assert_not_equals(videoSettings.deviceId, audioSettings.deviceId,
56 'video and audio device IDs should be different')
57 });
58 }, 'Video and audio device IDs are different');
36 </script> 59 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698