| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/environment.h" | 11 #include "base/environment.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/run_loop.h" |
| 16 #include "base/single_thread_task_runner.h" |
| 15 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 16 #include "base/test/test_timeouts.h" | 18 #include "base/test/test_timeouts.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 18 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 19 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 20 #include "media/audio/audio_device_description.h" | 22 #include "media/audio/audio_device_description.h" |
| 21 #include "media/audio/audio_io.h" | 23 #include "media/audio/audio_io.h" |
| 22 #include "media/audio/audio_unittest_util.h" | 24 #include "media/audio/audio_unittest_util.h" |
| 23 #include "media/audio/fake_audio_log_factory.h" | 25 #include "media/audio/fake_audio_log_factory.h" |
| 24 #include "media/base/seekable_buffer.h" | 26 #include "media/base/seekable_buffer.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 DVLOG(0) << " sample_rate : " << aisw.sample_rate(); | 424 DVLOG(0) << " sample_rate : " << aisw.sample_rate(); |
| 423 DVLOG(0) << " samples_per_packet: " << aisw.samples_per_packet(); | 425 DVLOG(0) << " samples_per_packet: " << aisw.samples_per_packet(); |
| 424 DVLOG(0) << " channels : " << aisw.channels(); | 426 DVLOG(0) << " channels : " << aisw.channels(); |
| 425 | 427 |
| 426 ais->Start(&full_duplex); | 428 ais->Start(&full_duplex); |
| 427 aos->Start(&full_duplex); | 429 aos->Start(&full_duplex); |
| 428 | 430 |
| 429 // Wait for approximately 10 seconds. The user shall hear his own voice | 431 // Wait for approximately 10 seconds. The user shall hear his own voice |
| 430 // in loop back during this time. At the same time, delay recordings are | 432 // in loop back during this time. At the same time, delay recordings are |
| 431 // performed and stored in the output text file. | 433 // performed and stored in the output text file. |
| 432 message_loop()->PostDelayedTask(FROM_HERE, | 434 message_loop()->task_runner()->PostDelayedTask( |
| 433 base::MessageLoop::QuitWhenIdleClosure(), | 435 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
| 434 TestTimeouts::action_timeout()); | 436 TestTimeouts::action_timeout()); |
| 435 message_loop()->Run(); | 437 base::RunLoop().Run(); |
| 436 | 438 |
| 437 aos->Stop(); | 439 aos->Stop(); |
| 438 ais->Stop(); | 440 ais->Stop(); |
| 439 | 441 |
| 440 // All Close() operations that run on the mocked audio thread, | 442 // All Close() operations that run on the mocked audio thread, |
| 441 // should be synchronous and not post additional close tasks to | 443 // should be synchronous and not post additional close tasks to |
| 442 // mocked the audio thread. Hence, there is no need to call | 444 // mocked the audio thread. Hence, there is no need to call |
| 443 // message_loop()->RunUntilIdle() after the Close() methods. | 445 // message_loop()->RunUntilIdle() after the Close() methods. |
| 444 aos->Close(); | 446 aos->Close(); |
| 445 ais->Close(); | 447 ais->Close(); |
| 446 } | 448 } |
| 447 | 449 |
| 448 } // namespace media | 450 } // namespace media |
| OLD | NEW |