| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 MOCK_METHOD1(Stop, void(FilterCallback* callback)); | 177 MOCK_METHOD1(Stop, void(FilterCallback* callback)); |
| 178 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 178 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
| 179 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb)); | 179 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb)); |
| 180 MOCK_METHOD0(OnAudioRendererDisabled, void()); | 180 MOCK_METHOD0(OnAudioRendererDisabled, void()); |
| 181 | 181 |
| 182 // VideoDecoder implementation. | 182 // VideoDecoder implementation. |
| 183 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, | 183 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, |
| 184 FilterCallback* callback, | 184 FilterCallback* callback, |
| 185 StatisticsCallback* stats_callback)); | 185 StatisticsCallback* stats_callback)); |
| 186 MOCK_METHOD1(ProduceVideoFrame, void(scoped_refptr<VideoFrame>)); | 186 MOCK_METHOD1(ProduceVideoFrame, void(scoped_refptr<VideoFrame>)); |
| 187 MOCK_METHOD0(width, int()); | 187 MOCK_METHOD0(natural_size, gfx::Size()); |
| 188 MOCK_METHOD0(height, int()); | |
| 189 | 188 |
| 190 void VideoFrameReadyForTest(scoped_refptr<VideoFrame> frame) { | 189 void VideoFrameReadyForTest(scoped_refptr<VideoFrame> frame) { |
| 191 VideoDecoder::VideoFrameReady(frame); | 190 VideoDecoder::VideoFrameReady(frame); |
| 192 } | 191 } |
| 193 | 192 |
| 194 protected: | 193 protected: |
| 195 virtual ~MockVideoDecoder(); | 194 virtual ~MockVideoDecoder(); |
| 196 | 195 |
| 197 private: | 196 private: |
| 198 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); | 197 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 public: | 349 public: |
| 351 MockStatisticsCallback(); | 350 MockStatisticsCallback(); |
| 352 ~MockStatisticsCallback(); | 351 ~MockStatisticsCallback(); |
| 353 | 352 |
| 354 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 353 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 355 }; | 354 }; |
| 356 | 355 |
| 357 } // namespace media | 356 } // namespace media |
| 358 | 357 |
| 359 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 358 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |