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

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

Issue 10826174: Dead code elimination: scythe.chrome_functions:segment.path %media% edition, round 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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/fake_audio_output_stream.h ('k') | media/audio/linux/audio_manager_linux.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 "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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 MOCK_METHOD3(OnMoreData, uint32(uint8* dest, uint32 max_size, 71 MOCK_METHOD3(OnMoreData, uint32(uint8* dest, uint32 max_size,
72 AudioBuffersState buffers_state)); 72 AudioBuffersState buffers_state));
73 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); 73 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code));
74 }; 74 };
75 75
76 class MockAudioManagerLinux : public AudioManagerLinux { 76 class MockAudioManagerLinux : public AudioManagerLinux {
77 public: 77 public:
78 MOCK_METHOD0(Init, void()); 78 MOCK_METHOD0(Init, void());
79 MOCK_METHOD0(HasAudioOutputDevices, bool()); 79 MOCK_METHOD0(HasAudioOutputDevices, bool());
80 MOCK_METHOD0(HasAudioInputDevices, bool()); 80 MOCK_METHOD0(HasAudioInputDevices, bool());
81 MOCK_METHOD0(MuteAll, void());
82 MOCK_METHOD0(UnMuteAll, void());
83 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( 81 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*(
84 const AudioParameters& params)); 82 const AudioParameters& params));
85 MOCK_METHOD1(MakeLowLatencyOutputStream, AudioOutputStream*( 83 MOCK_METHOD1(MakeLowLatencyOutputStream, AudioOutputStream*(
86 const AudioParameters& params)); 84 const AudioParameters& params));
87 MOCK_METHOD2(MakeLinearOutputStream, AudioInputStream*(
88 const AudioParameters& params, const std::string& device_id));
89 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( 85 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*(
90 const AudioParameters& params, const std::string& device_id)); 86 const AudioParameters& params, const std::string& device_id));
91 87
92 // We need to override this function in order to skip the checking the number 88 // We need to override this function in order to skip the checking the number
93 // of active output streams. It is because the number of active streams 89 // of active output streams. It is because the number of active streams
94 // is managed inside MakeAudioOutputStream, and we don't use 90 // is managed inside MakeAudioOutputStream, and we don't use
95 // MakeAudioOutputStream to create the stream in the tests. 91 // MakeAudioOutputStream to create the stream in the tests.
96 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { 92 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE {
97 DCHECK(stream); 93 DCHECK(stream);
98 delete stream; 94 delete stream;
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 847
852 // TODO(ajwong): Find a way to test whether or not another task has been 848 // TODO(ajwong): Find a way to test whether or not another task has been
853 // posted so we can verify that the Alsa code will indeed break the task 849 // posted so we can verify that the Alsa code will indeed break the task
854 // posting loop. 850 // posting loop.
855 851
856 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); 852 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed);
857 test_stream->Close(); 853 test_stream->Close();
858 } 854 }
859 855
860 } // namespace media 856 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/fake_audio_output_stream.h ('k') | media/audio/linux/audio_manager_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698