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

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: 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') | media/base/pipeline_unittest.cc » ('J')
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 private: 269 private:
270 scoped_refptr<MockDemuxer> demuxer_; 270 scoped_refptr<MockDemuxer> demuxer_;
271 scoped_refptr<MockVideoDecoder> video_decoder_; 271 scoped_refptr<MockVideoDecoder> video_decoder_;
272 scoped_refptr<MockAudioDecoder> audio_decoder_; 272 scoped_refptr<MockAudioDecoder> audio_decoder_;
273 scoped_refptr<MockVideoRenderer> video_renderer_; 273 scoped_refptr<MockVideoRenderer> video_renderer_;
274 scoped_refptr<MockAudioRenderer> audio_renderer_; 274 scoped_refptr<MockAudioRenderer> audio_renderer_;
275 275
276 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); 276 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection);
277 }; 277 };
278 278
279 // Helper gmock action that calls SetError() on behalf of the provided filter.
280 ACTION_P2(SetError, filter, error) {
281 filter->host()->SetError(error);
282 }
283
284 ACTION(RunClosure) { 279 ACTION(RunClosure) {
285 arg0.Run(); 280 arg0.Run();
286 } 281 }
287 282
288 // Helper mock statistics callback. 283 // Helper mock statistics callback.
289 class MockStatisticsCB { 284 class MockStatisticsCB {
290 public: 285 public:
291 MockStatisticsCB(); 286 MockStatisticsCB();
292 ~MockStatisticsCB(); 287 ~MockStatisticsCB();
293 288
294 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 289 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
295 }; 290 };
296 291
297 } // namespace media 292 } // namespace media
298 293
299 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 294 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline.h » ('j') | media/base/pipeline_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698