Skip to content

Commit

Permalink
Support display surface when using fake UI for media stream
Browse files Browse the repository at this point in the history
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 <beaufort.francois@gmail.com>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Fr <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1056850}
  • Loading branch information
beaufortfrancois authored and chromium-wpt-export-bot committed Oct 10, 2022
1 parent 5223e80 commit a9e78f9
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions screen-capture/getdisplaymedia.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,19 @@
assert_equals(track.readyState, "ended");
}, 'getDisplayMedia() resolves with stream with video track');

promise_test(async t => {
const stream = await getDisplayMedia({video: true});
t.add_cleanup(() => stopTracks(stream));
const settings = stream.getVideoTracks()[0].getSettings();
assert_any(
assert_equals, settings.displaySurface,
['monitor', 'window', 'browser']);
assert_any(assert_equals, settings.logicalSurface, [true, false]);
assert_any(assert_equals, settings.cursor, ['never', 'always', 'motion']);
}, 'getDisplayMedia() with getSettings');
{
const displaySurfaces = ['monitor', 'window', 'browser'];
displaySurfaces.forEach((displaySurface) => {
promise_test(async t => {
const stream = await getDisplayMedia({video: {displaySurface}});
t.add_cleanup(() => stopTracks(stream));
const settings = stream.getVideoTracks()[0].getSettings();
assert_equals(settings.displaySurface, displaySurface);
assert_any(assert_equals, settings.logicalSurface, [true, false]);
assert_any(assert_equals, settings.cursor, ['never', 'always', 'motion']);
}, `getDisplayMedia({"video":{"displaySurface":"${displaySurface}"}}) with getSettings`);
})
}

{
const properties = ["displaySurface"];
Expand Down

0 comments on commit a9e78f9

Please sign in to comment.