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

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

Issue 518433002: Revert of Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 void CreateRecorder(size_t channels, 92 void CreateRecorder(size_t channels,
93 size_t sample_rate, 93 size_t sample_rate,
94 size_t bits_per_sample, 94 size_t bits_per_sample,
95 size_t samples) { 95 size_t samples) {
96 DeleteRecorder(); 96 DeleteRecorder();
97 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 97 params_.Reset(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
98 kDefaultChannelLayout, 98 kDefaultChannelLayout,
99 channels, 99 channels,
100 2,
101 sample_rate, 100 sample_rate,
102 bits_per_sample, 101 bits_per_sample,
103 4096); 102 4096);
104 103
105 channel_data_.clear(); 104 channel_data_.clear();
106 channel_data_.push_back(GenerateSamples(0x1337, samples)); 105 channel_data_.push_back(GenerateSamples(0x1337, samples));
107 channel_data_.push_back(GenerateSamples(0x7331, samples)); 106 channel_data_.push_back(GenerateSamples(0x7331, samples));
108 107
109 total_samples_ = samples; 108 total_samples_ = samples;
110 109
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 kDefaultChannels, kDefaultSampleRate, kDefaultBitsPerSample, kNumSamples); 243 kDefaultChannels, kDefaultSampleRate, kDefaultBitsPerSample, kNumSamples);
245 244
246 RecordAndVerifySamples(); 245 RecordAndVerifySamples();
247 246
248 DeleteRecorder(); 247 DeleteRecorder();
249 } 248 }
250 249
251 // TODO(rkc): Add tests with recording different sample rates. 250 // TODO(rkc): Add tests with recording different sample rates.
252 251
253 } // namespace copresence 252 } // namespace copresence
OLDNEW
« no previous file with comments | « components/copresence/mediums/audio/audio_recorder.cc ('k') | content/browser/media/media_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698