| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 }; | 414 }; |
| 415 | 415 |
| 416 // Test fixture class for tests which only exercise the output path. | 416 // Test fixture class for tests which only exercise the output path. |
| 417 class AudioAndroidOutputTest : public testing::Test { | 417 class AudioAndroidOutputTest : public testing::Test { |
| 418 public: | 418 public: |
| 419 AudioAndroidOutputTest() | 419 AudioAndroidOutputTest() |
| 420 : loop_(new base::MessageLoopForUI()), | 420 : loop_(new base::MessageLoopForUI()), |
| 421 audio_manager_(AudioManager::CreateForTesting(loop_->task_runner())), | 421 audio_manager_(AudioManager::CreateForTesting(loop_->task_runner())), |
| 422 audio_output_stream_(NULL) { | 422 audio_output_stream_(NULL) { |
| 423 // Flush the message loop to ensure that AudioManager is fully initialized. | 423 // Flush the message loop to ensure that AudioManager is fully initialized. |
| 424 loop_->RunUntilIdle(); | 424 base::RunLoop().RunUntilIdle(); |
| 425 } | 425 } |
| 426 | 426 |
| 427 ~AudioAndroidOutputTest() override { | 427 ~AudioAndroidOutputTest() override { |
| 428 audio_manager_.reset(); | 428 audio_manager_.reset(); |
| 429 loop_->RunUntilIdle(); | 429 base::RunLoop().RunUntilIdle(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 protected: | 432 protected: |
| 433 AudioManager* audio_manager() { return audio_manager_.get(); } | 433 AudioManager* audio_manager() { return audio_manager_.get(); } |
| 434 const AudioParameters& audio_output_parameters() { | 434 const AudioParameters& audio_output_parameters() { |
| 435 return audio_output_parameters_; | 435 return audio_output_parameters_; |
| 436 } | 436 } |
| 437 | 437 |
| 438 // Synchronously runs the provided callback/closure on the audio thread. | 438 // Synchronously runs the provided callback/closure on the audio thread. |
| 439 void RunOnAudioThread(const base::Closure& closure) { | 439 void RunOnAudioThread(const base::Closure& closure) { |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); | 971 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20)); |
| 972 printf("\n"); | 972 printf("\n"); |
| 973 StopAndCloseAudioOutputStreamOnAudioThread(); | 973 StopAndCloseAudioOutputStreamOnAudioThread(); |
| 974 StopAndCloseAudioInputStreamOnAudioThread(); | 974 StopAndCloseAudioInputStreamOnAudioThread(); |
| 975 } | 975 } |
| 976 | 976 |
| 977 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, | 977 INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest, |
| 978 testing::ValuesIn(RunAudioRecordInputPathTests())); | 978 testing::ValuesIn(RunAudioRecordInputPathTests())); |
| 979 | 979 |
| 980 } // namespace media | 980 } // namespace media |
| OLD | NEW |