| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 DVLOG(0) << " samples_per_packet: " << aisw.samples_per_packet(); | 412 DVLOG(0) << " samples_per_packet: " << aisw.samples_per_packet(); |
| 413 DVLOG(0) << " channels : " << aisw.channels(); | 413 DVLOG(0) << " channels : " << aisw.channels(); |
| 414 | 414 |
| 415 ais->Start(&full_duplex); | 415 ais->Start(&full_duplex); |
| 416 aos->Start(&full_duplex); | 416 aos->Start(&full_duplex); |
| 417 | 417 |
| 418 // Wait for approximately 10 seconds. The user shall hear his own voice | 418 // Wait for approximately 10 seconds. The user shall hear his own voice |
| 419 // in loop back during this time. At the same time, delay recordings are | 419 // in loop back during this time. At the same time, delay recordings are |
| 420 // performed and stored in the output text file. | 420 // performed and stored in the output text file. |
| 421 message_loop()->PostDelayedTask(FROM_HERE, | 421 message_loop()->PostDelayedTask(FROM_HERE, |
| 422 base::MessageLoop::QuitClosure(), TestTimeouts::action_timeout()); | 422 base::MessageLoop::QuitWhenIdleClosure(), |
| 423 TestTimeouts::action_timeout()); |
| 423 message_loop()->Run(); | 424 message_loop()->Run(); |
| 424 | 425 |
| 425 aos->Stop(); | 426 aos->Stop(); |
| 426 ais->Stop(); | 427 ais->Stop(); |
| 427 | 428 |
| 428 // All Close() operations that run on the mocked audio thread, | 429 // All Close() operations that run on the mocked audio thread, |
| 429 // should be synchronous and not post additional close tasks to | 430 // should be synchronous and not post additional close tasks to |
| 430 // mocked the audio thread. Hence, there is no need to call | 431 // mocked the audio thread. Hence, there is no need to call |
| 431 // message_loop()->RunUntilIdle() after the Close() methods. | 432 // message_loop()->RunUntilIdle() after the Close() methods. |
| 432 aos->Close(); | 433 aos->Close(); |
| 433 ais->Close(); | 434 ais->Close(); |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace media | 437 } // namespace media |
| OLD | NEW |