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

Side by Side Diff: content/renderer/media/audio_track_recorder_unittest.cc

Issue 1610473002: MediaRecorder: wire the bitRate settings in Blink and content (2nd go) (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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/audio_track_recorder.h" 5 #include "content/renderer/media/audio_track_recorder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 440, /* frequency */ 90 440, /* frequency */
91 first_params_.sample_rate()), /* sample rate */ 91 first_params_.sample_rate()), /* sample rate */
92 second_source_(second_params_.channels(), 92 second_source_(second_params_.channels(),
93 440, 93 440,
94 second_params_.sample_rate()), 94 second_params_.sample_rate()),
95 opus_decoder_(nullptr) { 95 opus_decoder_(nullptr) {
96 ResetDecoder(first_params_); 96 ResetDecoder(first_params_);
97 PrepareBlinkTrack(); 97 PrepareBlinkTrack();
98 audio_track_recorder_.reset(new AudioTrackRecorder( 98 audio_track_recorder_.reset(new AudioTrackRecorder(
99 blink_track_, base::Bind(&AudioTrackRecorderTest::OnEncodedAudio, 99 blink_track_, base::Bind(&AudioTrackRecorderTest::OnEncodedAudio,
100 base::Unretained(this)))); 100 base::Unretained(this)),
101 0 /* bits_per_second */));
101 } 102 }
102 103
103 ~AudioTrackRecorderTest() { 104 ~AudioTrackRecorderTest() {
104 opus_decoder_destroy(opus_decoder_); 105 opus_decoder_destroy(opus_decoder_);
105 opus_decoder_ = nullptr; 106 opus_decoder_ = nullptr;
106 audio_track_recorder_.reset(); 107 audio_track_recorder_.reset();
107 blink_track_.reset(); 108 blink_track_.reset();
108 blink::WebHeap::collectAllGarbageForTesting(); 109 blink::WebHeap::collectAllGarbageForTesting();
109 } 110 }
110 111
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 .WillOnce(RunClosure(quit_closure)); 248 .WillOnce(RunClosure(quit_closure));
248 audio_track_recorder_->OnData(*GetSecondSourceAudioBus(), time3); 249 audio_track_recorder_->OnData(*GetSecondSourceAudioBus(), time3);
249 250
250 run_loop.Run(); 251 run_loop.Run();
251 Mock::VerifyAndClearExpectations(this); 252 Mock::VerifyAndClearExpectations(this);
252 } 253 }
253 254
254 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); 255 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams));
255 256
256 } // namespace content 257 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698