OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 23 matching lines...) Expand all Loading... |
34 }; | 34 }; |
35 | 35 |
36 class MockAudioManagerCrasInput : public AudioManagerCras { | 36 class MockAudioManagerCrasInput : public AudioManagerCras { |
37 public: | 37 public: |
38 MockAudioManagerCrasInput() : AudioManagerCras(&fake_audio_log_factory_) {} | 38 MockAudioManagerCrasInput() : AudioManagerCras(&fake_audio_log_factory_) {} |
39 | 39 |
40 // We need to override this function in order to skip checking the number | 40 // We need to override this function in order to skip checking the number |
41 // of active output streams. It is because the number of active streams | 41 // of active output streams. It is because the number of active streams |
42 // is managed inside MakeAudioInputStream, and we don't use | 42 // is managed inside MakeAudioInputStream, and we don't use |
43 // MakeAudioInputStream to create the stream in the tests. | 43 // MakeAudioInputStream to create the stream in the tests. |
44 virtual void ReleaseInputStream(AudioInputStream* stream) OVERRIDE { | 44 virtual void ReleaseInputStream(AudioInputStream* stream) override { |
45 DCHECK(stream); | 45 DCHECK(stream); |
46 delete stream; | 46 delete stream; |
47 } | 47 } |
48 | 48 |
49 private: | 49 private: |
50 FakeAudioLogFactory fake_audio_log_factory_; | 50 FakeAudioLogFactory fake_audio_log_factory_; |
51 }; | 51 }; |
52 | 52 |
53 class CrasInputStreamTest : public testing::Test { | 53 class CrasInputStreamTest : public testing::Test { |
54 protected: | 54 protected: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 AudioParameters params_stereo(kTestFormat, | 206 AudioParameters params_stereo(kTestFormat, |
207 CHANNEL_LAYOUT_STEREO, | 207 CHANNEL_LAYOUT_STEREO, |
208 rates[i], | 208 rates[i], |
209 kTestBitsPerSample, | 209 kTestBitsPerSample, |
210 kTestFramesPerPacket); | 210 kTestFramesPerPacket); |
211 CaptureSomeFrames(params_stereo, kTestCaptureDurationMs); | 211 CaptureSomeFrames(params_stereo, kTestCaptureDurationMs); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 } // namespace media | 215 } // namespace media |
OLD | NEW |