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

Side by Side Diff: media/base/mock_filters.h

Issue 7796033: Replace AudioDecoderConfig with simple accessors on AudioDecoder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 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/base/filters.h ('k') | media/filters/audio_renderer_base.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // A new breed of mock media filters, this time using gmock! Feel free to add 5 // A new breed of mock media filters, this time using gmock! Feel free to add
6 // actions if you need interesting side-effects (i.e., copying data to the 6 // actions if you need interesting side-effects (i.e., copying data to the
7 // buffer passed into MockDataSource::Read()). 7 // buffer passed into MockDataSource::Read()).
8 // 8 //
9 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock 9 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock
10 // filters to fail the test or do nothing when an unexpected method is called. 10 // filters to fail the test or do nothing when an unexpected method is called.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // Filter implementation. 205 // Filter implementation.
206 MOCK_METHOD1(Stop, void(FilterCallback* callback)); 206 MOCK_METHOD1(Stop, void(FilterCallback* callback));
207 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 207 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
208 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb)); 208 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb));
209 MOCK_METHOD0(OnAudioRendererDisabled, void()); 209 MOCK_METHOD0(OnAudioRendererDisabled, void());
210 210
211 // AudioDecoder implementation. 211 // AudioDecoder implementation.
212 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, 212 MOCK_METHOD3(Initialize, void(DemuxerStream* stream,
213 FilterCallback* callback, 213 FilterCallback* callback,
214 StatisticsCallback* stats_callback)); 214 StatisticsCallback* stats_callback));
215 MOCK_METHOD0(config, AudioDecoderConfig());
216 MOCK_METHOD1(ProduceAudioSamples, void(scoped_refptr<Buffer>)); 215 MOCK_METHOD1(ProduceAudioSamples, void(scoped_refptr<Buffer>));
216 MOCK_METHOD0(bits_per_channel, int(void));
217 MOCK_METHOD0(channel_layout, ChannelLayout(void));
218 MOCK_METHOD0(sample_rate, int(void));
217 219
218 void ConsumeAudioSamplesForTest(scoped_refptr<Buffer> buffer) { 220 void ConsumeAudioSamplesForTest(scoped_refptr<Buffer> buffer) {
219 AudioDecoder::ConsumeAudioSamples(buffer); 221 AudioDecoder::ConsumeAudioSamples(buffer);
220 } 222 }
221 223
222 protected: 224 protected:
223 virtual ~MockAudioDecoder(); 225 virtual ~MockAudioDecoder();
224 226
225 private: 227 private:
226 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); 228 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 public: 352 public:
351 MockStatisticsCallback(); 353 MockStatisticsCallback();
352 ~MockStatisticsCallback(); 354 ~MockStatisticsCallback();
353 355
354 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 356 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
355 }; 357 };
356 358
357 } // namespace media 359 } // namespace media
358 360
359 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 361 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698