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

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: Use common target size calculation 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
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..7b6e59cbe2c17c24bca7dbf466875c99df4ae3f2 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
@@ -46,6 +46,37 @@ 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 testharness due to limitations in mocking.
+ // The Web-Platform-Test that does the same thing passes when run
+ // in a browser.
+ // BUG=to-be-assigned
+ // assert_equals(settings.deviceId, settings1.deviceId);
+ // assert_equals(settings.width, settings1.width / 2,
Guido Urdaneta 2017/03/13 14:12:37 would it make sense to make a content_browsertest?
hta - Chromium 2017/03/13 15:04:35 Probably. Does content_browsertest fully support c
Guido Urdaneta 2017/03/13 15:08:24 Yes, it does.
+ // '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();

Powered by Google App Engine
This is Rietveld 408576698