Skip to content

Commit

Permalink
Make track.stats nullable for better feature detection.
Browse files Browse the repository at this point in the history
Motivation: w3c/mediacapture-extensions#122

Will merge this CL only if the spec issue gets resolved.

Bug: chromium:1472978
Change-Id: Ie5164b12a0cce03f2ad86205a7576c798ab651e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4977420
Reviewed-by: Florent Castelli <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1215524}
  • Loading branch information
henbos authored and chromium-wpt-export-bot committed Oct 26, 2023
1 parent 6bfefe0 commit 190d99a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,17 @@
const [track] = stream.getTracks();
t.add_cleanup(() => track.stop());

assert_throws_dom('NotSupportedError', () => track.stats);
}, `track.stats throws on audio tracks`);
assert_equals(track.stats, null);
}, `track.stats is null on audio tracks`);

promise_test(async t => {
const canvas = document.createElement('canvas');
const stream = canvas.captureStream(10);
const [track] = stream.getTracks();
t.add_cleanup(() => track.stop());

assert_throws_dom('NotSupportedError', () => track.stats);
}, `track.stats throws on non-device tracks, such as canvas`);
assert_equals(track.stats, null);
}, `track.stats is null on non-device tracks, such as canvas`);

promise_test(async t => {
// getDisplayMedia() requires inducing a user gesture.
Expand Down

0 comments on commit 190d99a

Please sign in to comment.