| 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 private: | 130 private: |
| 131 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); | 131 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 class MockVideoRenderer : public VideoRenderer { | 134 class MockVideoRenderer : public VideoRenderer { |
| 135 public: | 135 public: |
| 136 MockVideoRenderer(); | 136 MockVideoRenderer(); |
| 137 virtual ~MockVideoRenderer(); | 137 virtual ~MockVideoRenderer(); |
| 138 | 138 |
| 139 // VideoRenderer implementation. | 139 // VideoRenderer implementation. |
| 140 MOCK_METHOD10(Initialize, void(const scoped_refptr<DemuxerStream>& stream, | 140 MOCK_METHOD9(Initialize, void(const scoped_refptr<DemuxerStream>& stream, |
| 141 const VideoDecoderList& decoders, | 141 const PipelineStatusCB& init_cb, |
| 142 const PipelineStatusCB& init_cb, | 142 const StatisticsCB& statistics_cb, |
| 143 const StatisticsCB& statistics_cb, | 143 const TimeCB& time_cb, |
| 144 const TimeCB& time_cb, | 144 const NaturalSizeChangedCB& size_changed_cb, |
| 145 const NaturalSizeChangedCB& size_changed_cb, | 145 const base::Closure& ended_cb, |
| 146 const base::Closure& ended_cb, | 146 const PipelineStatusCB& error_cb, |
| 147 const PipelineStatusCB& error_cb, | 147 const TimeDeltaCB& get_time_cb, |
| 148 const TimeDeltaCB& get_time_cb, | 148 const TimeDeltaCB& get_duration_cb)); |
| 149 const TimeDeltaCB& get_duration_cb)); | |
| 150 MOCK_METHOD1(Play, void(const base::Closure& callback)); | 149 MOCK_METHOD1(Play, void(const base::Closure& callback)); |
| 151 MOCK_METHOD1(Pause, void(const base::Closure& callback)); | 150 MOCK_METHOD1(Pause, void(const base::Closure& callback)); |
| 152 MOCK_METHOD1(Flush, void(const base::Closure& callback)); | 151 MOCK_METHOD1(Flush, void(const base::Closure& callback)); |
| 153 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); | 152 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); |
| 154 MOCK_METHOD1(Stop, void(const base::Closure& callback)); | 153 MOCK_METHOD1(Stop, void(const base::Closure& callback)); |
| 155 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 154 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
| 156 | 155 |
| 157 private: | 156 private: |
| 158 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); | 157 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); |
| 159 }; | 158 }; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 public: | 231 public: |
| 233 MockStatisticsCB(); | 232 MockStatisticsCB(); |
| 234 ~MockStatisticsCB(); | 233 ~MockStatisticsCB(); |
| 235 | 234 |
| 236 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 235 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 237 }; | 236 }; |
| 238 | 237 |
| 239 } // namespace media | 238 } // namespace media |
| 240 | 239 |
| 241 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 240 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |