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

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

Issue 11359100: Add RunCallback to invoke a callback parameter in unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 years, 1 month 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 | « media/base/gmock_callback_support_unittest.cc ('k') | media/base/pipeline_unittest.cc » ('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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 private: 298 private:
299 scoped_refptr<MockDemuxer> demuxer_; 299 scoped_refptr<MockDemuxer> demuxer_;
300 scoped_refptr<MockVideoDecoder> video_decoder_; 300 scoped_refptr<MockVideoDecoder> video_decoder_;
301 scoped_refptr<MockAudioDecoder> audio_decoder_; 301 scoped_refptr<MockAudioDecoder> audio_decoder_;
302 scoped_refptr<MockVideoRenderer> video_renderer_; 302 scoped_refptr<MockVideoRenderer> video_renderer_;
303 scoped_refptr<MockAudioRenderer> audio_renderer_; 303 scoped_refptr<MockAudioRenderer> audio_renderer_;
304 304
305 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); 305 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection);
306 }; 306 };
307 307
308 ACTION(RunClosure) {
309 arg0.Run();
310 }
311
312 // Helper mock statistics callback. 308 // Helper mock statistics callback.
313 class MockStatisticsCB { 309 class MockStatisticsCB {
314 public: 310 public:
315 MockStatisticsCB(); 311 MockStatisticsCB();
316 ~MockStatisticsCB(); 312 ~MockStatisticsCB();
317 313
318 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 314 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
319 }; 315 };
320 316
321 } // namespace media 317 } // namespace media
322 318
323 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 319 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/gmock_callback_support_unittest.cc ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698