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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html

Issue 1682483002: MediaRecorder: remove ASSERTS in bitrate clamping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj@ comments Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
index 4b758abd671a9880593df14dc81df6330aa9a252..b8b549a99a0d4f299540e0996ddc196a1f26a2c6 100644
--- a/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
+++ b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
@@ -32,16 +32,21 @@ const kTooLargeBps = 1000000000;
const kOkVideoBps = 500000;
const kMinVideoBps = 100000;
+// Note that unspecified audio bitrates are not clamped to a minimum.
makeExpectedBitrateAsyncTest({ videoBitsPerSecond : kOkVideoBps },
'Video bitrate OK',
{ video : kOkVideoBps, audio : 0 });
makeExpectedBitrateAsyncTest({ videoBitsPerSecond : kTooSmallBps },
'Video bitrate clamped to minimum',
{ video : kMinVideoBps, audio : 0 });
+makeExpectedBitrateAsyncTest({ videoBitsPerSecond : 0 },
+ 'Video bitrate explicitly set to 0 is clamped',
+ { video : kMinVideoBps, audio : 0 });
const kOkAudioBps = 10000;
const kMinAudioBps = 6000; // https://www.opus-codec.org/
const kMaxAudioBps = 128000;
+// Note that unspecified video bitrates are not clamped to a minimum.
makeExpectedBitrateAsyncTest({ audioBitsPerSecond : kOkAudioBps },
'Audio bitrate OK',
{ audio : kOkAudioBps, video : 0 });
@@ -51,6 +56,14 @@ makeExpectedBitrateAsyncTest({ audioBitsPerSecond : kTooSmallBps },
makeExpectedBitrateAsyncTest({ audioBitsPerSecond : kTooLargeBps },
'Audio bitrate clamped to maximum',
{ audio : kMaxAudioBps , video : 0});
+makeExpectedBitrateAsyncTest({ audioBitsPerSecond : 0 },
+ 'Audio bitrate explicitly 0 is clamped',
+ { audio : kMinAudioBps, video : 0 });
+
+makeExpectedBitrateAsyncTest({},
+ 'Unspecified bitrates are not clamped',
+ { video : 0, audio : 0 });
+
makeExpectedBitrateAsyncTest({ videoBitsPerSecond : kOkVideoBps, audioBitsPerSecond : kOkAudioBps },
'Video and audio bitrates OK',
{ video : kOkVideoBps, audio : kOkAudioBps });
@@ -61,10 +74,10 @@ makeExpectedBitrateAsyncTest({ bitsPerSecond : kOkOverallBps },
{ video : kOkOverallBps * 0.9, audio : kOkOverallBps * 0.1 });
makeExpectedBitrateAsyncTest({ videoBitsPerSecond : kOkVideoBps, bitsPerSecond : kOkOverallBps },
'Overall bitrate OK, w/ explicit video bitrate ignored',
- { video : kOkOverallBps * 0.9, audio : kOkOverallBps * 0.1 });
+ { video : kOkOverallBps * 0.9, audio : kOkOverallBps * 0.1 });
makeExpectedBitrateAsyncTest({ audioBitsPerSecond : kOkAudioBps, bitsPerSecond : kOkOverallBps },
- 'Overall bitrate OK, w/ explicit audio bitrate ignored',
- { video : kOkOverallBps * 0.9, audio : kOkOverallBps * 0.1 });
+ 'Overall bitrate OK, w/ explicit audio bitrate ignored',
+ { video : kOkOverallBps * 0.9, audio : kOkOverallBps * 0.1 });
makeExpectedBitrateAsyncTest({ bitsPerSecond : 10E6 },
'Overall bitrate leads to audio clamped to its maximum',
@@ -76,5 +89,16 @@ makeExpectedBitrateAsyncTest({ bitsPerSecond : kTooSmallBps },
'Overall bitrate leads to both audio and video clamped to min',
{ video : kMinVideoBps, audio : kMinAudioBps });
+makeExpectedBitrateAsyncTest({ videoBitsPerSecond: kOkVideoBps, bitsPerSecond: 0 },
+ 'Overall bitrate 0 overrides specified video bitrate',
+ { video: kMinVideoBps, audio: kMinAudioBps });
+makeExpectedBitrateAsyncTest({ audioBitsPerSecond: kOkAudioBps, bitsPerSecond: 0 },
+ 'Overall bitrate 0 overrides specified audio bitrate',
+ { video: kMinVideoBps, audio: kMinAudioBps });
+
+const kMaxInt32Value = Math.pow(2, 31) - 1;
+makeExpectedBitrateAsyncTest({ bitsPerSecond : -1 },
+ 'Overall bitrate too large is clamped',
+ { video : kMaxInt32Value - kMaxAudioBps, audio : kMaxAudioBps});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698