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

Side by Side Diff: components/copresence/mediums/audio/audio_recorder_unittest.cc

Issue 453203002: Fixing memory leak in TimedMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging to HEAD Created 6 years, 4 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 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
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.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698