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

Unified Diff: content/renderer/media/media_recorder_handler_unittest.cc

Issue 1579693006: MediaRecorder: support sampling rate adaption in AudioTrackRecorder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: content/renderer/media/media_recorder_handler_unittest.cc
diff --git a/content/renderer/media/media_recorder_handler_unittest.cc b/content/renderer/media/media_recorder_handler_unittest.cc
index 6989ca68adef2886d764f313243161cfc61a41fc..c31302e2d48ead5e2842efe0743c1be7223467cd 100644
--- a/content/renderer/media/media_recorder_handler_unittest.cc
+++ b/content/renderer/media/media_recorder_handler_unittest.cc
@@ -41,7 +41,8 @@ static const std::string kTestAudioTrackId = "audio_track_id";
static const int kTestAudioChannels = 2;
static const int kTestAudioBitsPerSample = 16;
static const int kTestAudioSampleRate = 48000;
-static const int kTestAudioBufferDurationMS = 60;
+// MediaStream Audio Tack always provides chunks 10 ms of audio data.
+static const int kMediaStreamAudioTrackBufferDurationMs = 10;
struct MediaRecorderTestParams {
const bool has_video;
@@ -59,7 +60,7 @@ struct MediaRecorderTestParams {
static const MediaRecorderTestParams kMediaRecorderTestParams[] = {
{true, false, "video/webm", "vp8", 52, 32, 0, 0},
{true, false, "video/webm", "vp9", 33, 18, 0, 0},
- {false, true, "video/webm", "vp8", 0, 0, 990, 706}};
+ {false, true, "video/webm", "vp8", 0, 0, 248, 125}};
class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
public blink::WebMediaRecorderHandlerClient {
@@ -113,7 +114,7 @@ class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
scoped_ptr<media::AudioBus> NextAudioBus() {
scoped_ptr<media::AudioBus> bus(media::AudioBus::Create(
kTestAudioChannels,
- kTestAudioSampleRate * kTestAudioBufferDurationMS / 1000));
+ kTestAudioSampleRate * kMediaStreamAudioTrackBufferDurationMs / 1000));
audio_source_.OnMoreData(bus.get(), 0, 0);
return bus;
}
@@ -286,7 +287,7 @@ TEST_P(MediaRecorderHandlerTest, EncodeAudioFrames) {
media::AudioParameters params(
media::AudioParameters::AUDIO_PCM_LINEAR, media::CHANNEL_LAYOUT_STEREO,
kTestAudioSampleRate, kTestAudioBitsPerSample,
- kTestAudioSampleRate * kTestAudioBufferDurationMS / 1000);
+ kTestAudioSampleRate * kMediaStreamAudioTrackBufferDurationMs / 1000);
SetAudioFormatForTesting(params);
{

Powered by Google App Engine
This is Rietveld 408576698