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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "media/audio/alsa/alsa_output.h" | 6 #include "media/audio/alsa/alsa_output.h" |
7 #include "media/audio/alsa/alsa_wrapper.h" | 7 #include "media/audio/alsa/alsa_wrapper.h" |
8 #include "media/audio/alsa/audio_manager_alsa.h" | 8 #include "media/audio/alsa/audio_manager_alsa.h" |
9 #include "media/audio/fake_audio_log_factory.h" | 9 #include "media/audio/fake_audio_log_factory.h" |
10 #include "media/audio/mock_audio_source_callback.h" | 10 #include "media/audio/mock_audio_source_callback.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 }; | 68 }; |
69 | 69 |
70 class MockAudioManagerAlsa : public AudioManagerAlsa { | 70 class MockAudioManagerAlsa : public AudioManagerAlsa { |
71 public: | 71 public: |
72 MockAudioManagerAlsa() : AudioManagerAlsa(&fake_audio_log_factory_) {} | 72 MockAudioManagerAlsa() : AudioManagerAlsa(&fake_audio_log_factory_) {} |
73 MOCK_METHOD0(Init, void()); | 73 MOCK_METHOD0(Init, void()); |
74 MOCK_METHOD0(HasAudioOutputDevices, bool()); | 74 MOCK_METHOD0(HasAudioOutputDevices, bool()); |
75 MOCK_METHOD0(HasAudioInputDevices, bool()); | 75 MOCK_METHOD0(HasAudioInputDevices, bool()); |
76 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( | 76 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( |
77 const AudioParameters& params)); | 77 const AudioParameters& params)); |
78 MOCK_METHOD3(MakeLowLatencyOutputStream, AudioOutputStream*( | 78 MOCK_METHOD2(MakeLowLatencyOutputStream, AudioOutputStream*( |
79 const AudioParameters& params, | 79 const AudioParameters& params, |
80 const std::string& device_id, | 80 const std::string& device_id)); |
81 const std::string& input_device_id)); | |
82 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( | 81 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( |
83 const AudioParameters& params, const std::string& device_id)); | 82 const AudioParameters& params, const std::string& device_id)); |
84 | 83 |
85 // We need to override this function in order to skip the checking the number | 84 // We need to override this function in order to skip the checking the number |
86 // of active output streams. It is because the number of active streams | 85 // of active output streams. It is because the number of active streams |
87 // is managed inside MakeAudioOutputStream, and we don't use | 86 // is managed inside MakeAudioOutputStream, and we don't use |
88 // MakeAudioOutputStream to create the stream in the tests. | 87 // MakeAudioOutputStream to create the stream in the tests. |
89 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { | 88 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { |
90 DCHECK(stream); | 89 DCHECK(stream); |
91 delete stream; | 90 delete stream; |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 | 855 |
857 // TODO(ajwong): Find a way to test whether or not another task has been | 856 // TODO(ajwong): Find a way to test whether or not another task has been |
858 // posted so we can verify that the Alsa code will indeed break the task | 857 // posted so we can verify that the Alsa code will indeed break the task |
859 // posting loop. | 858 // posting loop. |
860 | 859 |
861 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); | 860 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); |
862 test_stream->Close(); | 861 test_stream->Close(); |
863 } | 862 } |
864 | 863 |
865 } // namespace media | 864 } // namespace media |
OLD | NEW |