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

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

Issue 3030013: preparation for recycling buffer, patch 2 (Closed)
Patch Set: fix layout test Created 10 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
« no previous file with comments | « media/base/filters.h ('k') | media/base/pipeline_impl.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 MOCK_METHOD1(Stop, void(FilterCallback* callback)); 165 MOCK_METHOD1(Stop, void(FilterCallback* callback));
166 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 166 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
167 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback)); 167 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback));
168 MOCK_METHOD0(OnAudioRendererDisabled, void()); 168 MOCK_METHOD0(OnAudioRendererDisabled, void());
169 169
170 // VideoDecoder implementation. 170 // VideoDecoder implementation.
171 MOCK_METHOD2(Initialize, void(DemuxerStream* stream, 171 MOCK_METHOD2(Initialize, void(DemuxerStream* stream,
172 FilterCallback* callback)); 172 FilterCallback* callback));
173 MOCK_METHOD0(media_format, const MediaFormat&()); 173 MOCK_METHOD0(media_format, const MediaFormat&());
174 MOCK_METHOD1(FillThisBuffer, void(scoped_refptr<VideoFrame>)); 174 MOCK_METHOD1(FillThisBuffer, void(scoped_refptr<VideoFrame>));
175 MOCK_METHOD0(ProvidesBuffer, bool());
175 176
176 protected: 177 protected:
177 virtual ~MockVideoDecoder() {} 178 virtual ~MockVideoDecoder() {}
178 179
179 private: 180 private:
180 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); 181 DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder);
181 }; 182 };
182 183
183 class MockAudioDecoder : public AudioDecoder { 184 class MockAudioDecoder : public AudioDecoder {
184 public: 185 public:
(...skipping 30 matching lines...) Expand all
215 // MediaFilter implementation. 216 // MediaFilter implementation.
216 MOCK_METHOD1(Stop, void(FilterCallback* callback)); 217 MOCK_METHOD1(Stop, void(FilterCallback* callback));
217 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 218 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
218 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback)); 219 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback));
219 MOCK_METHOD0(OnAudioRendererDisabled, void()); 220 MOCK_METHOD0(OnAudioRendererDisabled, void());
220 221
221 // VideoRenderer implementation. 222 // VideoRenderer implementation.
222 MOCK_METHOD2(Initialize, void(VideoDecoder* decoder, 223 MOCK_METHOD2(Initialize, void(VideoDecoder* decoder,
223 FilterCallback* callback)); 224 FilterCallback* callback));
224 MOCK_METHOD0(HasEnded, bool()); 225 MOCK_METHOD0(HasEnded, bool());
226 MOCK_METHOD1(FillThisBufferDone, void(scoped_refptr<VideoFrame> frame));
225 227
226 protected: 228 protected:
227 virtual ~MockVideoRenderer() {} 229 virtual ~MockVideoRenderer() {}
228 230
229 private: 231 private:
230 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); 232 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer);
231 }; 233 };
232 234
233 class MockAudioRenderer : public AudioRenderer { 235 class MockAudioRenderer : public AudioRenderer {
234 public: 236 public:
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 361
360 // Helper gmock action that calls DisableAudioRenderer() on behalf of the 362 // Helper gmock action that calls DisableAudioRenderer() on behalf of the
361 // provided filter. 363 // provided filter.
362 ACTION_P(DisableAudioRenderer, filter) { 364 ACTION_P(DisableAudioRenderer, filter) {
363 filter->host()->DisableAudioRenderer(); 365 filter->host()->DisableAudioRenderer();
364 } 366 }
365 367
366 } // namespace media 368 } // namespace media
367 369
368 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 370 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/base/pipeline_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698