OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |