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

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

Issue 8897022: Revert 113895 - <video> decode in hardware! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/filters.cc ('k') | media/base/mock_filters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 MockVideoDecoder(); 181 MockVideoDecoder();
182 182
183 // Filter implementation. 183 // Filter implementation.
184 MOCK_METHOD1(Stop, void(const base::Closure& callback)); 184 MOCK_METHOD1(Stop, void(const base::Closure& callback));
185 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 185 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
186 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb)); 186 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb));
187 MOCK_METHOD0(OnAudioRendererDisabled, void()); 187 MOCK_METHOD0(OnAudioRendererDisabled, void());
188 188
189 // VideoDecoder implementation. 189 // VideoDecoder implementation.
190 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, 190 MOCK_METHOD3(Initialize, void(DemuxerStream* stream,
191 const PipelineStatusCB& callback, 191 const base::Closure& callback,
192 const StatisticsCallback& stats_callback)); 192 const StatisticsCallback& stats_callback));
193 MOCK_METHOD1(Read, void(const ReadCB& callback)); 193 MOCK_METHOD1(Read, void(const ReadCB& callback));
194 MOCK_METHOD0(natural_size, const gfx::Size&()); 194 MOCK_METHOD0(natural_size, const gfx::Size&());
195 195
196 protected: 196 protected:
197 virtual ~MockVideoDecoder(); 197 virtual ~MockVideoDecoder();
198 198
199 private: 199 private:
200 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); 200 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder);
201 }; 201 };
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection); 316 DISALLOW_COPY_AND_ASSIGN(MockFilterCollection);
317 }; 317 };
318 318
319 // Helper gmock functions that immediately executes and destroys the 319 // Helper gmock functions that immediately executes and destroys the
320 // Closure on behalf of the provided filter. Can be used when mocking 320 // Closure on behalf of the provided filter. Can be used when mocking
321 // the Initialize() and Seek() methods. 321 // the Initialize() and Seek() methods.
322 void RunFilterCallback(::testing::Unused, const base::Closure& callback); 322 void RunFilterCallback(::testing::Unused, const base::Closure& callback);
323 void RunFilterStatusCB(::testing::Unused, const FilterStatusCB& cb); 323 void RunFilterStatusCB(::testing::Unused, const FilterStatusCB& cb);
324 void RunPipelineStatusCB(PipelineStatus status, const PipelineStatusCB& cb); 324 void RunPipelineStatusCB(PipelineStatus status, const PipelineStatusCB& cb);
325 void RunPipelineStatusOKCB(const PipelineStatusCB& cb); // Always PIPELINE_OK.
326 void RunFilterCallback3(::testing::Unused, const base::Closure& callback, 325 void RunFilterCallback3(::testing::Unused, const base::Closure& callback,
327 ::testing::Unused); 326 ::testing::Unused);
328 327
329 // Helper gmock function that immediately executes the Closure on behalf of the 328 // Helper gmock function that immediately executes the Closure on behalf of the
330 // provided filter. Can be used when mocking the Stop() method. 329 // provided filter. Can be used when mocking the Stop() method.
331 void RunStopFilterCallback(const base::Closure& callback); 330 void RunStopFilterCallback(const base::Closure& callback);
332 331
333 // Helper gmock action that calls SetError() on behalf of the provided filter. 332 // Helper gmock action that calls SetError() on behalf of the provided filter.
334 ACTION_P2(SetError, filter, error) { 333 ACTION_P2(SetError, filter, error) {
335 filter->host()->SetError(error); 334 filter->host()->SetError(error);
(...skipping 16 matching lines...) Expand all
352 public: 351 public:
353 MockStatisticsCallback(); 352 MockStatisticsCallback();
354 ~MockStatisticsCallback(); 353 ~MockStatisticsCallback();
355 354
356 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 355 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
357 }; 356 };
358 357
359 } // namespace media 358 } // namespace media
360 359
361 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 360 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/filters.cc ('k') | media/base/mock_filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698