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 "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/test/test_message_loop.h" | 10 #include "base/test/test_message_loop.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 public: | 77 public: |
78 MockAudioManagerAlsa() | 78 MockAudioManagerAlsa() |
79 : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(), | 79 : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(), |
80 base::ThreadTaskRunnerHandle::Get(), | 80 base::ThreadTaskRunnerHandle::Get(), |
81 &fake_audio_log_factory_) {} | 81 &fake_audio_log_factory_) {} |
82 MOCK_METHOD0(Init, void()); | 82 MOCK_METHOD0(Init, void()); |
83 MOCK_METHOD0(HasAudioOutputDevices, bool()); | 83 MOCK_METHOD0(HasAudioOutputDevices, bool()); |
84 MOCK_METHOD0(HasAudioInputDevices, bool()); | 84 MOCK_METHOD0(HasAudioInputDevices, bool()); |
85 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( | 85 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( |
86 const AudioParameters& params)); | 86 const AudioParameters& params)); |
87 MOCK_METHOD2(MakeLowLatencyOutputStream, AudioOutputStream*( | 87 MOCK_METHOD3( |
88 const AudioParameters& params, | 88 MakeLowLatencyOutputStream, |
89 const std::string& device_id)); | 89 AudioOutputStream*(const AudioParameters& params, |
| 90 const std::string& device_id, |
| 91 const StatisticsCallback& statistics_callback)); |
90 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( | 92 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( |
91 const AudioParameters& params, const std::string& device_id)); | 93 const AudioParameters& params, const std::string& device_id)); |
92 | 94 |
93 // We need to override this function in order to skip the checking the number | 95 // We need to override this function in order to skip the checking the number |
94 // of active output streams. It is because the number of active streams | 96 // of active output streams. It is because the number of active streams |
95 // is managed inside MakeAudioOutputStream, and we don't use | 97 // is managed inside MakeAudioOutputStream, and we don't use |
96 // MakeAudioOutputStream to create the stream in the tests. | 98 // MakeAudioOutputStream to create the stream in the tests. |
97 void ReleaseOutputStream(AudioOutputStream* stream) override { | 99 void ReleaseOutputStream(AudioOutputStream* stream) override { |
98 DCHECK(stream); | 100 DCHECK(stream); |
99 delete stream; | 101 delete stream; |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 856 |
855 // TODO(ajwong): Find a way to test whether or not another task has been | 857 // TODO(ajwong): Find a way to test whether or not another task has been |
856 // posted so we can verify that the Alsa code will indeed break the task | 858 // posted so we can verify that the Alsa code will indeed break the task |
857 // posting loop. | 859 // posting loop. |
858 | 860 |
859 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); | 861 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); |
860 test_stream->Close(); | 862 test_stream->Close(); |
861 } | 863 } |
862 | 864 |
863 } // namespace media | 865 } // namespace media |
OLD | NEW |