Skip to content

Commit

Permalink
[webrtc-stats] Only expose hardware capabilities when capturing media
Browse files Browse the repository at this point in the history
With a recent change to the webrtc-stats spec, user agents with a
fullscreen element will no longer have access to stats which expose
hardware capabilities.

The WPT tests for hardware capability stats has been updated to reflect
the fact that having a fullscreen element is not sufficient anymore,
rather than just removing these tests. This helps catch user agents that
have not updated to reflect this change to the spec.

Bug: 1398362
Change-Id: I221be5bfb900952c29459ce38b1fa1460205a1e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4084785
Auto-Submit: Evan Shrubsole <[email protected]>
Commit-Queue: Harald Alvestrand <[email protected]>
Reviewed-by: Harald Alvestrand <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1080815}
  • Loading branch information
eshrubs authored and chromium-wpt-export-bot committed Dec 8, 2022
1 parent 40090b3 commit ec58998
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webrtc-stats/hardware-capability-stats.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
const stream = await getNoiseStream({video: true, audio: true});
const statsEntry = await setupPcAndGetStatEntry(t, stream, type, kind, stat);
assert_not_own_property(statsEntry, stat);
}, stat + " not exposed when not capturing or fullscreen.");
}, stat + " not exposed when not capturing.");

// Exposing hardware capabilities when a there is a fullscreen element was
// removed with https://github.com/w3c/webrtc-stats/pull/713.
promise_test(async (t) => {
const stream = await getNoiseStream({video: true, audio: true});

Expand All @@ -87,8 +89,8 @@

const statsEntry = await setupPcAndGetStatEntry(
t, stream, type, kind, stat);
assert_own_property(statsEntry, stat);
}, stat + " exposed when fullscreen.");
assert_not_own_property(statsEntry, stat);
}, stat + " not exposed when fullscreen and not capturing.");

promise_test(async (t) => {
const stream = await navigator.mediaDevices.getUserMedia(
Expand Down

0 comments on commit ec58998

Please sign in to comment.