| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |