Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(774)

Side by Side Diff: media/base/mock_filters.h

Issue 10832197: Add a lot of Pipeline tests to cover stopping/error handling while in a variety of states. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: todo Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/pipeline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 private: 267 private:
268 scoped_refptr<MockDemuxer> demuxer_; 268 scoped_refptr<MockDemuxer> demuxer_;
269 scoped_refptr<MockVideoDecoder> video_decoder_; 269 scoped_refptr<MockVideoDecoder> video_decoder_;
270 scoped_refptr<MockAudioDecoder> audio_decoder_; 270 scoped_refptr<MockAudioDecoder> audio_decoder_;
271 scoped_refptr<MockVideoRenderer> video_renderer_; 271 scoped_refptr<MockVideoRenderer> video_renderer_;
272 scoped_refptr<MockAudioRenderer> audio_renderer_; 272 scoped_refptr<MockAudioRenderer> audio_renderer_;
273 273
274 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); 274 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection);
275 }; 275 };
276 276
277 // Helper gmock action that calls SetError() on behalf of the provided filter.
278 ACTION_P2(SetError, filter, error) {
279 filter->host()->SetError(error);
280 }
281
282 ACTION(RunClosure) { 277 ACTION(RunClosure) {
283 arg0.Run(); 278 arg0.Run();
284 } 279 }
285 280
286 // Helper mock statistics callback. 281 // Helper mock statistics callback.
287 class MockStatisticsCB { 282 class MockStatisticsCB {
288 public: 283 public:
289 MockStatisticsCB(); 284 MockStatisticsCB();
290 ~MockStatisticsCB(); 285 ~MockStatisticsCB();
291 286
292 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 287 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
293 }; 288 };
294 289
295 } // namespace media 290 } // namespace media
296 291
297 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 292 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698