OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 // Helper gmock action that calls DisableAudioRenderer() on behalf of the | 314 // Helper gmock action that calls DisableAudioRenderer() on behalf of the |
315 // provided filter. | 315 // provided filter. |
316 ACTION_P(DisableAudioRenderer, filter) { | 316 ACTION_P(DisableAudioRenderer, filter) { |
317 filter->host()->DisableAudioRenderer(); | 317 filter->host()->DisableAudioRenderer(); |
318 } | 318 } |
319 | 319 |
320 // Helper mock statistics callback. | 320 // Helper mock statistics callback. |
321 class MockStatisticsCallback { | 321 class MockStatisticsCallback { |
322 public: | 322 public: |
| 323 MockStatisticsCallback(); |
| 324 ~MockStatisticsCallback(); |
| 325 |
323 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 326 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
324 }; | 327 }; |
325 | 328 |
326 } // namespace media | 329 } // namespace media |
327 | 330 |
328 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 331 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
OLD | NEW |