| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); | 162 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 class MockAudioRenderer : public AudioRenderer { | 165 class MockAudioRenderer : public AudioRenderer { |
| 166 public: | 166 public: |
| 167 MockAudioRenderer(); | 167 MockAudioRenderer(); |
| 168 | 168 |
| 169 // AudioRenderer implementation. | 169 // AudioRenderer implementation. |
| 170 MOCK_METHOD7(Initialize, void(const scoped_refptr<AudioDecoder>& decoder, | 170 MOCK_METHOD9(Initialize, void(const scoped_refptr<DemuxerStream>& stream, |
| 171 const AudioDecoderList& decoders, |
| 171 const PipelineStatusCB& init_cb, | 172 const PipelineStatusCB& init_cb, |
| 173 const StatisticsCB& statistics_cb, |
| 172 const base::Closure& underflow_cb, | 174 const base::Closure& underflow_cb, |
| 173 const TimeCB& time_cb, | 175 const TimeCB& time_cb, |
| 174 const base::Closure& ended_cb, | 176 const base::Closure& ended_cb, |
| 175 const base::Closure& disabled_cb, | 177 const base::Closure& disabled_cb, |
| 176 const PipelineStatusCB& error_cb)); | 178 const PipelineStatusCB& error_cb)); |
| 177 MOCK_METHOD1(Play, void(const base::Closure& callback)); | 179 MOCK_METHOD1(Play, void(const base::Closure& callback)); |
| 178 MOCK_METHOD1(Pause, void(const base::Closure& callback)); | 180 MOCK_METHOD1(Pause, void(const base::Closure& callback)); |
| 179 MOCK_METHOD1(Flush, void(const base::Closure& callback)); | 181 MOCK_METHOD1(Flush, void(const base::Closure& callback)); |
| 180 MOCK_METHOD1(Stop, void(const base::Closure& callback)); | 182 MOCK_METHOD1(Stop, void(const base::Closure& callback)); |
| 181 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 183 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 public: | 287 public: |
| 286 MockStatisticsCB(); | 288 MockStatisticsCB(); |
| 287 ~MockStatisticsCB(); | 289 ~MockStatisticsCB(); |
| 288 | 290 |
| 289 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 291 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 290 }; | 292 }; |
| 291 | 293 |
| 292 } // namespace media | 294 } // namespace media |
| 293 | 295 |
| 294 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 296 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |