Skip to content

Commit a9e78f9

Browse files
Support display surface when using fake UI for media stream
This CL adds support in web platform tests for the MediaTrackSupportedConstraints displaySurface[1] and updates a web platform test. [1] https://w3c.github.io/mediacapture-screen-share/#dfn-displaysurface Bug: 1224912 Change-Id: Id0b577cfafaa59ff73bf5841338b723f7d8e9513 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3936847 Commit-Queue: Fr <[email protected]> Reviewed-by: Guido Urdaneta <[email protected]> Reviewed-by: Fr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1056850}
1 parent 5223e80 commit a9e78f9

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

screen-capture/getdisplaymedia.https.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,19 @@
197197
assert_equals(track.readyState, "ended");
198198
}, 'getDisplayMedia() resolves with stream with video track');
199199

200-
promise_test(async t => {
201-
const stream = await getDisplayMedia({video: true});
202-
t.add_cleanup(() => stopTracks(stream));
203-
const settings = stream.getVideoTracks()[0].getSettings();
204-
assert_any(
205-
assert_equals, settings.displaySurface,
206-
['monitor', 'window', 'browser']);
207-
assert_any(assert_equals, settings.logicalSurface, [true, false]);
208-
assert_any(assert_equals, settings.cursor, ['never', 'always', 'motion']);
209-
}, 'getDisplayMedia() with getSettings');
200+
{
201+
const displaySurfaces = ['monitor', 'window', 'browser'];
202+
displaySurfaces.forEach((displaySurface) => {
203+
promise_test(async t => {
204+
const stream = await getDisplayMedia({video: {displaySurface}});
205+
t.add_cleanup(() => stopTracks(stream));
206+
const settings = stream.getVideoTracks()[0].getSettings();
207+
assert_equals(settings.displaySurface, displaySurface);
208+
assert_any(assert_equals, settings.logicalSurface, [true, false]);
209+
assert_any(assert_equals, settings.cursor, ['never', 'always', 'motion']);
210+
}, `getDisplayMedia({"video":{"displaySurface":"${displaySurface}"}}) with getSettings`);
211+
})
212+
}
210213

211214
{
212215
const properties = ["displaySurface"];

0 commit comments

Comments
 (0)