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

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

Issue 2742893003: Let getSettings() return the constrained track resolution, not source. (Closed)
Patch Set: Added bug # for non-working test Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/video_track_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
index 7401a32193a6ac12e75642875a3acdf94d61babf..e0cf76039dc0aabf056887ac0c6e3ab616607c25 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
@@ -46,6 +46,38 @@ promise_test(function() {
}, 'A video track returns the expected variables');
promise_test(function() {
+ track1 = null;
+ track2 = null;
+ return navigator.mediaDevices.getUserMedia({video: true})
+ .then(function(s1) {
+ track1 = s1.getVideoTracks()[0];
+ settings1 = track1.getSettings();
+ // We ask for the second track to have half the width of the first one,
+ // but the same source.
+ // This should cause a scaling factor to be applied.
+ constraints2 = {deviceId: settings1.deviceId,
+ width: { max: settings1.width / 2 }};
+ console.log(JSON.stringify(constraints2));
+ return navigator.mediaDevices.getUserMedia({video: constraints2});
+ })
+ .then(function(s) {
+ track2 = s.getVideoTracks()[0];
+ console.log(JSON.stringify(track2.getConstraints()));
+ settings = track2.getSettings();
+ settings1 = track1.getSettings();
+ // This test does not work in blink_tests due to limitations in mocking.
+ // The Web-Platform-Test that does the same thing passes when run
+ // in a browser.
+ // TODO(hta): Add constraints to the mock media stream registry.
+ // crbug.com/617152
+ // assert_equals(settings.deviceId, settings1.deviceId);
+ // assert_equals(settings.width, settings1.width / 2,
+ // 'widths are not 2x different: ' +
+ // JSON.stringify(settings) + ' ' + JSON.stringify(settings1));
+ });
+}, 'Two video tracks with the same source but different scaling are different');
+
+promise_test(function() {
return navigator.mediaDevices.getUserMedia({audio: true, video: true})
.then(function(s) {
videoSettings = s.getVideoTracks()[0].getSettings();
« no previous file with comments | « content/renderer/media/video_track_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698