Chromium Code Reviews| Index: media/audio/audio_low_latency_input_output_unittest.cc |
| diff --git a/media/audio/audio_low_latency_input_output_unittest.cc b/media/audio/audio_low_latency_input_output_unittest.cc |
| index 2ae700a874bd8d87b560418168c0570551c4b060..fbb9088f5f5648d643b9fa1050fe85d2efdb3362 100644 |
| --- a/media/audio/audio_low_latency_input_output_unittest.cc |
| +++ b/media/audio/audio_low_latency_input_output_unittest.cc |
| @@ -20,6 +20,8 @@ |
| #if defined(USE_ALSA) |
| #include "media/audio/alsa/audio_manager_alsa.h" |
| +#elif defined(USE_PULSEAUDIO) |
| +#include "media/audio/pulse/audio_manager_pulse.h" |
| #elif defined(OS_MACOSX) |
| #include "media/audio/mac/audio_manager_mac.h" |
| #elif defined(OS_WIN) |
| @@ -82,6 +84,7 @@ struct AudioDelayState { |
| // This class mocks the platform specific audio manager and overrides |
| // the GetMessageLoop() method to ensure that we can run our tests on |
| // the main thread instead of the audio thread. |
| +/* |
|
henrika (OOO until Aug 14)
2014/06/10 15:14:06
This complete test is actually disabled. I only us
|
| class MockAudioManager : public AudioManagerAnyPlatform { |
| public: |
| MockAudioManager() : AudioManagerAnyPlatform(&fake_audio_log_factory_) {} |
| @@ -95,15 +98,17 @@ class MockAudioManager : public AudioManagerAnyPlatform { |
| FakeAudioLogFactory fake_audio_log_factory_; |
| DISALLOW_COPY_AND_ASSIGN(MockAudioManager); |
| }; |
| +*/ |
| // Test fixture class. |
| class AudioLowLatencyInputOutputTest : public testing::Test { |
| protected: |
| - AudioLowLatencyInputOutputTest() {} |
| + AudioLowLatencyInputOutputTest() |
| + : audio_manager_(AudioManager::CreateForTesting()) {} |
| virtual ~AudioLowLatencyInputOutputTest() {} |
| - AudioManager* audio_manager() { return &mock_audio_manager_; } |
| + AudioManager* audio_manager() { return audio_manager_.get(); } |
| base::MessageLoopForUI* message_loop() { return &message_loop_; } |
| // Convenience method which ensures that we are not running on the build |
| @@ -118,7 +123,8 @@ class AudioLowLatencyInputOutputTest : public testing::Test { |
| private: |
| base::MessageLoopForUI message_loop_; |
| - MockAudioManager mock_audio_manager_; |
| + // MockAudioManager mock_audio_manager_; |
| + scoped_ptr<AudioManager> audio_manager_; |
| DISALLOW_COPY_AND_ASSIGN(AudioLowLatencyInputOutputTest); |
| }; |
| @@ -184,7 +190,7 @@ class FullDuplexAudioSinkSource |
| // AudioInputStream::AudioInputCallback. |
| virtual void OnData(AudioInputStream* stream, |
| - const uint8* src, uint32 size, |
| + const AudioBus* source, |
| uint32 hardware_delay_bytes, |
| double volume) OVERRIDE { |
| base::AutoLock lock(lock_); |
| @@ -203,6 +209,7 @@ class FullDuplexAudioSinkSource |
| ++input_elements_to_write_; |
| } |
| + /* |
| // Store the captured audio packet in a seekable media buffer. |
| if (!buffer_->Append(src, size)) { |
| // An attempt to write outside the buffer limits has been made. |
| @@ -211,6 +218,7 @@ class FullDuplexAudioSinkSource |
| buffer_->set_forward_capacity(2 * buffer_->forward_capacity()); |
| buffer_->Clear(); |
| } |
| + */ |
| } |
| virtual void OnError(AudioInputStream* stream) OVERRIDE {} |
| @@ -406,6 +414,8 @@ TEST_F(AudioLowLatencyInputOutputTest, DISABLED_FullDuplexDelayMeasurement) { |
| LOG(ERROR) << "This test requires symmetric input and output parameters. " |
| "Ensure that sample rate and number of channels are identical in " |
| "both directions"; |
| + DVLOG(1) << aisw.sample_rate() << " " << aosw.sample_rate(); |
| + DVLOG(1) << aisw.samples_per_packet() << " " << aosw.samples_per_packet(); |
| aos->Close(); |
| ais->Close(); |
| return; |