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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "base/threading/simple_thread.h" | 10 #include "base/threading/simple_thread.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 media::AudioDeviceNames* device_name)); | 84 media::AudioDeviceNames* device_name)); |
85 MOCK_METHOD0(IsRecordingInProcess, bool()); | 85 MOCK_METHOD0(IsRecordingInProcess, bool()); |
86 }; | 86 }; |
87 | 87 |
88 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { | 88 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { |
89 public: | 89 public: |
90 int OnMoreData(AudioBus* audio_bus, AudioBuffersState buffers_state) { | 90 int OnMoreData(AudioBus* audio_bus, AudioBuffersState buffers_state) { |
91 audio_bus->Zero(); | 91 audio_bus->Zero(); |
92 return audio_bus->frames(); | 92 return audio_bus->frames(); |
93 } | 93 } |
| 94 MOCK_METHOD3(OnMoreIOData, int(AudioBus* source, |
| 95 AudioBus* dest, |
| 96 AudioBuffersState buffers_state)); |
94 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); | 97 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); |
95 }; | 98 }; |
96 | 99 |
97 // Simple class for repeatedly calling OnMoreData() to expose shutdown issues | 100 // Simple class for repeatedly calling OnMoreData() to expose shutdown issues |
98 // with AudioSourceCallback users. | 101 // with AudioSourceCallback users. |
99 class AudioThreadRunner : public base::DelegateSimpleThread::Delegate { | 102 class AudioThreadRunner : public base::DelegateSimpleThread::Delegate { |
100 public: | 103 public: |
101 AudioThreadRunner(AudioOutputStream::AudioSourceCallback* callback, | 104 AudioThreadRunner(AudioOutputStream::AudioSourceCallback* callback, |
102 base::TimeDelta delay, const AudioParameters& params) | 105 base::TimeDelta delay, const AudioParameters& params) |
103 : delay_(delay), | 106 : delay_(delay), |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 proxy2->Close(); | 780 proxy2->Close(); |
778 WaitForCloseTimer(kTestCloseDelayMs); | 781 WaitForCloseTimer(kTestCloseDelayMs); |
779 } | 782 } |
780 #endif | 783 #endif |
781 | 784 |
782 TEST_F(AudioOutputResamplerTest, StartFailed) { | 785 TEST_F(AudioOutputResamplerTest, StartFailed) { |
783 StartFailed(resampler_); | 786 StartFailed(resampler_); |
784 } | 787 } |
785 | 788 |
786 } // namespace media | 789 } // namespace media |
OLD | NEW |