| OLD | NEW |
| 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 // 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); | 142 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class MockVideoDecoder : public VideoDecoder { | 145 class MockVideoDecoder : public VideoDecoder { |
| 146 public: | 146 public: |
| 147 MockVideoDecoder(); | 147 MockVideoDecoder(); |
| 148 | 148 |
| 149 // Filter implementation. | 149 // Filter implementation. |
| 150 MOCK_METHOD1(Flush, void(const base::Closure& callback)); |
| 150 MOCK_METHOD1(Stop, void(const base::Closure& callback)); | 151 MOCK_METHOD1(Stop, void(const base::Closure& callback)); |
| 151 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 152 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
| 152 MOCK_METHOD2(Seek, void(base::TimeDelta time, const PipelineStatusCB& cb)); | 153 MOCK_METHOD2(Seek, void(base::TimeDelta time, const PipelineStatusCB& cb)); |
| 153 MOCK_METHOD0(OnAudioRendererDisabled, void()); | 154 MOCK_METHOD0(OnAudioRendererDisabled, void()); |
| 154 | 155 |
| 155 // VideoDecoder implementation. | 156 // VideoDecoder implementation. |
| 156 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, | 157 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, |
| 157 const PipelineStatusCB& status_cb, | 158 const PipelineStatusCB& status_cb, |
| 158 const StatisticsCB& statistics_cb)); | 159 const StatisticsCB& statistics_cb)); |
| 159 MOCK_METHOD1(Read, void(const ReadCB& read_cb)); | 160 MOCK_METHOD1(Read, void(const ReadCB& read_cb)); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 public: | 309 public: |
| 309 MockStatisticsCB(); | 310 MockStatisticsCB(); |
| 310 ~MockStatisticsCB(); | 311 ~MockStatisticsCB(); |
| 311 | 312 |
| 312 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 313 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 313 }; | 314 }; |
| 314 | 315 |
| 315 } // namespace media | 316 } // namespace media |
| 316 | 317 |
| 317 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 318 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |