Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: media/audio/audio_output_proxy_unittest.cc

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_output_ipc.h ('k') | media/audio/audio_output_resampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/audio/audio_output_ipc.h ('k') | media/audio/audio_output_resampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698