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

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: removed =0 in MediaRecorderOptions, using has{,Video,Audio}BitsPerSecond() 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
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..7ff8f8e39ef97ee810d1306c1a08bcf43d64a692 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,15 @@ 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 });
@@ -76,5 +90,10 @@ makeExpectedBitrateAsyncTest({ bitsPerSecond : kTooSmallBps },
'Overall bitrate leads to both audio and video clamped to min',
{ video : kMinVideoBps, audio : kMinAudioBps });
+const kMaxUint32Value = 4294967296;
+const kMaxInt32Value = (kMaxUint32Value / 2) - 1;
philipj_slow 2016/02/15 04:12:27 Just kMaxInt32Value=2147483647 or Math.pow(2,31)-1
mcasas 2016/02/17 00:20:28 Done.
+makeExpectedBitrateAsyncTest({ bitsPerSecond : -1 },
+ 'Overall bitrate too large is clamped',
+ { video : kMaxInt32Value - kMaxAudioBps, audio : kMaxAudioBps});
</script>

Powered by Google App Engine
This is Rietveld 408576698