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

Side by Side Diff: media/audio/linux/alsa_output_unittest.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 years, 6 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
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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "media/audio/linux/alsa_output.h" 7 #include "media/audio/linux/alsa_output.h"
8 #include "media/audio/linux/alsa_wrapper.h" 8 #include "media/audio/linux/alsa_wrapper.h"
9 #include "media/audio/linux/audio_manager_linux.h" 9 #include "media/audio/linux/audio_manager_linux.h"
10 #include "media/base/data_buffer.h" 10 #include "media/base/data_buffer.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); 76 MOCK_METHOD1(OnError, void(AudioOutputStream* stream));
77 }; 77 };
78 78
79 class MockAudioManagerLinux : public AudioManagerLinux { 79 class MockAudioManagerLinux : public AudioManagerLinux {
80 public: 80 public:
81 MOCK_METHOD0(Init, void()); 81 MOCK_METHOD0(Init, void());
82 MOCK_METHOD0(HasAudioOutputDevices, bool()); 82 MOCK_METHOD0(HasAudioOutputDevices, bool());
83 MOCK_METHOD0(HasAudioInputDevices, bool()); 83 MOCK_METHOD0(HasAudioInputDevices, bool());
84 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( 84 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*(
85 const AudioParameters& params)); 85 const AudioParameters& params));
86 MOCK_METHOD1(MakeLowLatencyOutputStream, AudioOutputStream*( 86 MOCK_METHOD2(MakeLowLatencyOutputStream, AudioOutputStream*(
87 const AudioParameters& params)); 87 const AudioParameters& params, const std::string& input_device_id));
88 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( 88 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*(
89 const AudioParameters& params, const std::string& device_id)); 89 const AudioParameters& params, const std::string& device_id));
90 90
91 // We need to override this function in order to skip the checking the number 91 // We need to override this function in order to skip the checking the number
92 // of active output streams. It is because the number of active streams 92 // of active output streams. It is because the number of active streams
93 // is managed inside MakeAudioOutputStream, and we don't use 93 // is managed inside MakeAudioOutputStream, and we don't use
94 // MakeAudioOutputStream to create the stream in the tests. 94 // MakeAudioOutputStream to create the stream in the tests.
95 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { 95 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE {
96 DCHECK(stream); 96 DCHECK(stream);
97 delete stream; 97 delete stream;
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 859
860 // TODO(ajwong): Find a way to test whether or not another task has been 860 // TODO(ajwong): Find a way to test whether or not another task has been
861 // posted so we can verify that the Alsa code will indeed break the task 861 // posted so we can verify that the Alsa code will indeed break the task
862 // posting loop. 862 // posting loop.
863 863
864 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); 864 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed);
865 test_stream->Close(); 865 test_stream->Close();
866 } 866 }
867 867
868 } // namespace media 868 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698