| 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. | 6 // actions if you need interesting side-effects. |
| 7 // | 7 // |
| 8 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock | 8 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock |
| 9 // filters to fail the test or do nothing when an unexpected method is called. | 9 // filters to fail the test or do nothing when an unexpected method is called. |
| 10 // http://code.google.com/p/googlemock/wiki/CookBook#Nice_Mocks_and_Strict_Mocks | 10 // http://code.google.com/p/googlemock/wiki/CookBook#Nice_Mocks_and_Strict_Mocks |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); | 132 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 class MockVideoRenderer : public VideoRenderer { | 135 class MockVideoRenderer : public VideoRenderer { |
| 136 public: | 136 public: |
| 137 MockVideoRenderer(); | 137 MockVideoRenderer(); |
| 138 | 138 |
| 139 // VideoRenderer implementation. | 139 // VideoRenderer implementation. |
| 140 MOCK_METHOD9(Initialize, void(const scoped_refptr<VideoDecoder>& decoder, | 140 MOCK_METHOD10(Initialize, void(const scoped_refptr<DemuxerStream>& stream, |
| 141 const PipelineStatusCB& init_cb, | 141 const VideoDecoderList& decoders, |
| 142 const StatisticsCB& statistics_cb, | 142 const PipelineStatusCB& init_cb, |
| 143 const TimeCB& time_cb, | 143 const StatisticsCB& statistics_cb, |
| 144 const NaturalSizeChangedCB& size_changed_cb, | 144 const TimeCB& time_cb, |
| 145 const base::Closure& ended_cb, | 145 const NaturalSizeChangedCB& size_changed_cb, |
| 146 const PipelineStatusCB& error_cb, | 146 const base::Closure& ended_cb, |
| 147 const TimeDeltaCB& get_time_cb, | 147 const PipelineStatusCB& error_cb, |
| 148 const TimeDeltaCB& get_duration_cb)); | 148 const TimeDeltaCB& get_time_cb, |
| 149 const TimeDeltaCB& get_duration_cb)); |
| 149 MOCK_METHOD1(Play, void(const base::Closure& callback)); | 150 MOCK_METHOD1(Play, void(const base::Closure& callback)); |
| 150 MOCK_METHOD1(Pause, void(const base::Closure& callback)); | 151 MOCK_METHOD1(Pause, void(const base::Closure& callback)); |
| 151 MOCK_METHOD1(Flush, void(const base::Closure& callback)); | 152 MOCK_METHOD1(Flush, void(const base::Closure& callback)); |
| 152 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); | 153 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); |
| 153 MOCK_METHOD1(Stop, void(const base::Closure& callback)); | 154 MOCK_METHOD1(Stop, void(const base::Closure& callback)); |
| 154 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 155 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
| 156 MOCK_METHOD0(PrepareForShutdownHack, void()); |
| 155 | 157 |
| 156 protected: | 158 protected: |
| 157 virtual ~MockVideoRenderer(); | 159 virtual ~MockVideoRenderer(); |
| 158 | 160 |
| 159 private: | 161 private: |
| 160 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); | 162 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); |
| 161 }; | 163 }; |
| 162 | 164 |
| 163 class MockAudioRenderer : public AudioRenderer { | 165 class MockAudioRenderer : public AudioRenderer { |
| 164 public: | 166 public: |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 public: | 285 public: |
| 284 MockStatisticsCB(); | 286 MockStatisticsCB(); |
| 285 ~MockStatisticsCB(); | 287 ~MockStatisticsCB(); |
| 286 | 288 |
| 287 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 289 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 } // namespace media | 292 } // namespace media |
| 291 | 293 |
| 292 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 294 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |