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

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

Issue 8417019: Simplify VideoDecodeEngine interface by making everything synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: recycling: vanquished Created 9 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
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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Filter implementation. 180 // Filter implementation.
181 MOCK_METHOD1(Stop, void(const base::Closure& callback)); 181 MOCK_METHOD1(Stop, void(const base::Closure& callback));
182 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 182 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
183 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb)); 183 MOCK_METHOD2(Seek, void(base::TimeDelta time, const FilterStatusCB& cb));
184 MOCK_METHOD0(OnAudioRendererDisabled, void()); 184 MOCK_METHOD0(OnAudioRendererDisabled, void());
185 185
186 // VideoDecoder implementation. 186 // VideoDecoder implementation.
187 MOCK_METHOD3(Initialize, void(DemuxerStream* stream, 187 MOCK_METHOD3(Initialize, void(DemuxerStream* stream,
188 const base::Closure& callback, 188 const base::Closure& callback,
189 const StatisticsCallback& stats_callback)); 189 const StatisticsCallback& stats_callback));
190 MOCK_METHOD1(ProduceVideoFrame, void(scoped_refptr<VideoFrame>)); 190 MOCK_METHOD1(Read, void(const FrameReadyCB& callback));
191 MOCK_METHOD0(natural_size, gfx::Size()); 191 MOCK_METHOD0(natural_size, gfx::Size());
192 192
193 void VideoFrameReadyForTest(scoped_refptr<VideoFrame> frame) {
194 VideoDecoder::VideoFrameReady(frame);
195 }
196
197 protected: 193 protected:
198 virtual ~MockVideoDecoder(); 194 virtual ~MockVideoDecoder();
199 195
200 private: 196 private:
201 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); 197 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder);
202 }; 198 };
203 199
204 class MockAudioDecoder : public AudioDecoder { 200 class MockAudioDecoder : public AudioDecoder {
205 public: 201 public:
206 MockAudioDecoder(); 202 MockAudioDecoder();
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 public: 348 public:
353 MockStatisticsCallback(); 349 MockStatisticsCallback();
354 ~MockStatisticsCallback(); 350 ~MockStatisticsCallback();
355 351
356 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 352 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
357 }; 353 };
358 354
359 } // namespace media 355 } // namespace media
360 356
361 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 357 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698