| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 scoped_refptr<MockAudioRenderer> audio_renderer_; | 305 scoped_refptr<MockAudioRenderer> audio_renderer_; |
| 306 | 306 |
| 307 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); | 307 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 // Helper gmock functions that immediately executes and destroys the | 310 // Helper gmock functions that immediately executes and destroys the |
| 311 // FilterCallback on behalf of the provided filter. Can be used when mocking | 311 // FilterCallback on behalf of the provided filter. Can be used when mocking |
| 312 // the Initialize() and Seek() methods. | 312 // the Initialize() and Seek() methods. |
| 313 void RunFilterCallback(::testing::Unused, FilterCallback* callback); | 313 void RunFilterCallback(::testing::Unused, FilterCallback* callback); |
| 314 void RunFilterStatusCB(::testing::Unused, const FilterStatusCB& cb); | 314 void RunFilterStatusCB(::testing::Unused, const FilterStatusCB& cb); |
| 315 void RunPipelineStatusCallback(PipelineStatus status, | 315 void RunPipelineStatusCB(PipelineStatus status, const PipelineStatusCB& cb); |
| 316 PipelineStatusCallback* callback); | |
| 317 void RunFilterCallback3(::testing::Unused, FilterCallback* callback, | 316 void RunFilterCallback3(::testing::Unused, FilterCallback* callback, |
| 318 ::testing::Unused); | 317 ::testing::Unused); |
| 319 | 318 |
| 320 // Helper gmock function that immediately destroys the FilterCallback on behalf | 319 // Helper gmock function that immediately destroys the FilterCallback on behalf |
| 321 // of the provided filter. Can be used when mocking the Initialize() and Seek() | 320 // of the provided filter. Can be used when mocking the Initialize() and Seek() |
| 322 // methods. | 321 // methods. |
| 323 void DestroyFilterCallback(::testing::Unused, FilterCallback* callback); | 322 void DestroyFilterCallback(::testing::Unused, FilterCallback* callback); |
| 324 | 323 |
| 325 // Helper gmock function that immediately executes and destroys the | 324 // Helper gmock function that immediately executes and destroys the |
| 326 // FilterCallback on behalf of the provided filter. Can be used when mocking | 325 // FilterCallback on behalf of the provided filter. Can be used when mocking |
| (...skipping 22 matching lines...) Expand all Loading... |
| 349 public: | 348 public: |
| 350 MockStatisticsCallback(); | 349 MockStatisticsCallback(); |
| 351 ~MockStatisticsCallback(); | 350 ~MockStatisticsCallback(); |
| 352 | 351 |
| 353 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 352 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 354 }; | 353 }; |
| 355 | 354 |
| 356 } // namespace media | 355 } // namespace media |
| 357 | 356 |
| 358 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 357 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |