| Index: components/audio_modem/audio_recorder_unittest.cc
|
| diff --git a/components/audio_modem/audio_recorder_unittest.cc b/components/audio_modem/audio_recorder_unittest.cc
|
| index e960cd389b5289ea42dfa1fdec74286f63cb71a0..4b0d44c000a2ffcfe441b26d6700786f0d353cb9 100644
|
| --- a/components/audio_modem/audio_recorder_unittest.cc
|
| +++ b/components/audio_modem/audio_recorder_unittest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/macros.h"
|
| #include "base/memory/aligned_memory.h"
|
| #include "base/run_loop.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "build/build_config.h"
|
| #include "components/audio_modem/audio_recorder_impl.h"
|
| #include "components/audio_modem/public/audio_modem_types.h"
|
| @@ -82,8 +83,8 @@ namespace audio_modem {
|
| class AudioRecorderTest : public testing::Test {
|
| public:
|
| AudioRecorderTest() : total_samples_(0), recorder_(nullptr) {
|
| - if (!media::AudioManager::Get())
|
| - media::AudioManager::CreateForTesting();
|
| + audio_manager_ = media::AudioManager::CreateForTesting(
|
| + base::ThreadTaskRunnerHandle::Get());
|
| }
|
|
|
| ~AudioRecorderTest() override {
|
| @@ -131,6 +132,7 @@ class AudioRecorderTest : public testing::Test {
|
| return;
|
| recorder_->Finalize();
|
| recorder_ = nullptr;
|
| + base::RunLoop().RunUntilIdle();
|
| }
|
|
|
| void RecordAndVerifySamples() {
|
| @@ -183,10 +185,13 @@ class AudioRecorderTest : public testing::Test {
|
| return samples;
|
| }
|
| bool IsRecording() {
|
| - recorder_->FlushAudioLoopForTesting();
|
| + base::RunLoop().RunUntilIdle();
|
| return recorder_->is_recording_;
|
| }
|
|
|
| + content::TestBrowserThreadBundle thread_bundle_;
|
| + media::ScopedAudioManagerPtr audio_manager_;
|
| +
|
| std::vector<float*> channel_data_;
|
| media::AudioParameters params_;
|
| size_t total_samples_;
|
| @@ -197,7 +202,6 @@ class AudioRecorderTest : public testing::Test {
|
| std::string received_samples_;
|
|
|
| scoped_ptr<base::RunLoop> run_loop_;
|
| - content::TestBrowserThreadBundle thread_bundle_;
|
| };
|
|
|
|
|
|
|