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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 private: | 160 private: |
161 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); | 161 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); |
162 }; | 162 }; |
163 | 163 |
164 class MockAudioRenderer : public AudioRenderer { | 164 class MockAudioRenderer : public AudioRenderer { |
165 public: | 165 public: |
166 MockAudioRenderer(); | 166 MockAudioRenderer(); |
167 | 167 |
168 // AudioRenderer implementation. | 168 // AudioRenderer implementation. |
169 MOCK_METHOD7(Initialize, void(const scoped_refptr<AudioDecoder>& decoder, | 169 MOCK_METHOD9(Initialize, void(const scoped_refptr<DemuxerStream>& stream, |
| 170 const AudioDecoderList& decoders, |
170 const PipelineStatusCB& init_cb, | 171 const PipelineStatusCB& init_cb, |
| 172 const StatisticsCB& statistics_cb, |
171 const base::Closure& underflow_cb, | 173 const base::Closure& underflow_cb, |
172 const TimeCB& time_cb, | 174 const TimeCB& time_cb, |
173 const base::Closure& ended_cb, | 175 const base::Closure& ended_cb, |
174 const base::Closure& disabled_cb, | 176 const base::Closure& disabled_cb, |
175 const PipelineStatusCB& error_cb)); | 177 const PipelineStatusCB& error_cb)); |
176 MOCK_METHOD1(Play, void(const base::Closure& callback)); | 178 MOCK_METHOD1(Play, void(const base::Closure& callback)); |
177 MOCK_METHOD1(Pause, void(const base::Closure& callback)); | 179 MOCK_METHOD1(Pause, void(const base::Closure& callback)); |
178 MOCK_METHOD1(Flush, void(const base::Closure& callback)); | 180 MOCK_METHOD1(Flush, void(const base::Closure& callback)); |
179 MOCK_METHOD1(Stop, void(const base::Closure& callback)); | 181 MOCK_METHOD1(Stop, void(const base::Closure& callback)); |
180 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); | 182 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 public: | 302 public: |
301 MockStatisticsCB(); | 303 MockStatisticsCB(); |
302 ~MockStatisticsCB(); | 304 ~MockStatisticsCB(); |
303 | 305 |
304 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 306 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
305 }; | 307 }; |
306 | 308 |
307 } // namespace media | 309 } // namespace media |
308 | 310 |
309 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 311 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
OLD | NEW |