OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/copresence/mediums/audio/audio_recorder.h" | 5 #include "components/copresence/mediums/audio/audio_recorder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/aligned_memory.h" | 8 #include "base/memory/aligned_memory.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "components/copresence/public/copresence_constants.h" | 10 #include "components/copresence/public/copresence_constants.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 size_t total_samples_; | 182 size_t total_samples_; |
183 | 183 |
184 AudioRecorder* recorder_; | 184 AudioRecorder* recorder_; |
185 | 185 |
186 std::string received_samples_; | 186 std::string received_samples_; |
187 | 187 |
188 scoped_ptr<base::RunLoop> run_loop_; | 188 scoped_ptr<base::RunLoop> run_loop_; |
189 content::TestBrowserThreadBundle thread_bundle_; | 189 content::TestBrowserThreadBundle thread_bundle_; |
190 }; | 190 }; |
191 | 191 |
192 #if defined(OS_WIN) || defined(OS_MACOSX) | 192 // TODO(rkc): These tests are broken on all platforms. |
rkc
2014/08/09 19:20:37
I looked at that bot again. It isn't a fail, it is
Charlie
2014/08/11 16:10:18
This test is breaking the Linux valgrind bot:
htt
| |
193 // Windows does not let us use non-OS params. The tests need to be rewritten to | 193 // On Windows and Mac, we cannot use non-OS params. The tests need to be |
194 // use the params provided to us by the audio manager rather than setting our | 194 // rewritten to use the params provided to us by the audio manager |
195 // own params. | 195 // rather than setting our own params. |
196 // On Linux, there is a memory leak in the audio code during initialization. | |
196 #define MAYBE_BasicRecordAndStop DISABLED_BasicRecordAndStop | 197 #define MAYBE_BasicRecordAndStop DISABLED_BasicRecordAndStop |
197 #define MAYBE_OutOfOrderRecordAndStopMultiple DISABLED_OutOfOrderRecordAndStopMu ltiple | 198 #define MAYBE_OutOfOrderRecordAndStopMultiple DISABLED_OutOfOrderRecordAndStopMu ltiple |
198 #define MAYBE_RecordingEndToEnd DISABLED_RecordingEndToEnd | 199 #define MAYBE_RecordingEndToEnd DISABLED_RecordingEndToEnd |
199 #else | |
200 #define MAYBE_BasicRecordAndStop BasicRecordAndStop | |
201 #define MAYBE_OutOfOrderRecordAndStopMultiple OutOfOrderRecordAndStopMultiple | |
202 #define MAYBE_RecordingEndToEnd RecordingEndToEnd | |
203 #endif | |
204 | 200 |
205 TEST_F(AudioRecorderTest, MAYBE_BasicRecordAndStop) { | 201 TEST_F(AudioRecorderTest, MAYBE_BasicRecordAndStop) { |
206 CreateSimpleRecorder(); | 202 CreateSimpleRecorder(); |
207 | 203 |
208 recorder_->Record(); | 204 recorder_->Record(); |
209 EXPECT_TRUE(IsRecording()); | 205 EXPECT_TRUE(IsRecording()); |
210 recorder_->Stop(); | 206 recorder_->Stop(); |
211 EXPECT_FALSE(IsRecording()); | 207 EXPECT_FALSE(IsRecording()); |
212 recorder_->Record(); | 208 recorder_->Record(); |
213 | 209 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 kDefaultChannels, kDefaultSampleRate, kDefaultBitsPerSample, kNumSamples); | 244 kDefaultChannels, kDefaultSampleRate, kDefaultBitsPerSample, kNumSamples); |
249 | 245 |
250 RecordAndVerifySamples(); | 246 RecordAndVerifySamples(); |
251 | 247 |
252 DeleteRecorder(); | 248 DeleteRecorder(); |
253 } | 249 } |
254 | 250 |
255 // TODO(rkc): Add tests with recording different sample rates. | 251 // TODO(rkc): Add tests with recording different sample rates. |
256 | 252 |
257 } // namespace copresence | 253 } // namespace copresence |
OLD | NEW |