| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/audio/cras/audio_manager_cras.h" | 10 #include "media/audio/cras/audio_manager_cras.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 class MockAudioManagerCras : public AudioManagerCras { | 31 class MockAudioManagerCras : public AudioManagerCras { |
| 32 public: | 32 public: |
| 33 MockAudioManagerCras() : AudioManagerCras(&fake_audio_log_factory_) {} | 33 MockAudioManagerCras() : AudioManagerCras(&fake_audio_log_factory_) {} |
| 34 | 34 |
| 35 MOCK_METHOD0(Init, void()); | 35 MOCK_METHOD0(Init, void()); |
| 36 MOCK_METHOD0(HasAudioOutputDevices, bool()); | 36 MOCK_METHOD0(HasAudioOutputDevices, bool()); |
| 37 MOCK_METHOD0(HasAudioInputDevices, bool()); | 37 MOCK_METHOD0(HasAudioInputDevices, bool()); |
| 38 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( | 38 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( |
| 39 const AudioParameters& params)); | 39 const AudioParameters& params)); |
| 40 MOCK_METHOD3(MakeLowLatencyOutputStream, | 40 MOCK_METHOD2(MakeLowLatencyOutputStream, |
| 41 AudioOutputStream*(const AudioParameters& params, | 41 AudioOutputStream*(const AudioParameters& params, |
| 42 const std::string& device_id, | 42 const std::string& device_id)); |
| 43 const std::string& input_device_id)); | |
| 44 MOCK_METHOD2(MakeLinearOutputStream, AudioInputStream*( | 43 MOCK_METHOD2(MakeLinearOutputStream, AudioInputStream*( |
| 45 const AudioParameters& params, const std::string& device_id)); | 44 const AudioParameters& params, const std::string& device_id)); |
| 46 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( | 45 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( |
| 47 const AudioParameters& params, const std::string& device_id)); | 46 const AudioParameters& params, const std::string& device_id)); |
| 48 | 47 |
| 49 // We need to override this function in order to skip the checking the number | 48 // We need to override this function in order to skip the checking the number |
| 50 // of active output streams. It is because the number of active streams | 49 // of active output streams. It is because the number of active streams |
| 51 // is managed inside MakeAudioOutputStream, and we don't use | 50 // is managed inside MakeAudioOutputStream, and we don't use |
| 52 // MakeAudioOutputStream to create the stream in the tests. | 51 // MakeAudioOutputStream to create the stream in the tests. |
| 53 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { | 52 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 151 |
| 153 // Wait for samples to be captured. | 152 // Wait for samples to be captured. |
| 154 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); | 153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); |
| 155 | 154 |
| 156 test_stream->Stop(); | 155 test_stream->Stop(); |
| 157 | 156 |
| 158 test_stream->Close(); | 157 test_stream->Close(); |
| 159 } | 158 } |
| 160 | 159 |
| 161 } // namespace media | 160 } // namespace media |
| OLD | NEW |