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

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

Issue 164403: Implemented end-of-stream callback for media::PipelineImpl. (Closed)
Patch Set: Baz Created 11 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/mock_filter_host.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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 // MediaFilter implementation. 236 // MediaFilter implementation.
237 MOCK_METHOD0(Stop, void()); 237 MOCK_METHOD0(Stop, void());
238 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 238 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
239 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback)); 239 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback));
240 MOCK_METHOD1(OnReceivedMessage, void(FilterMessage message)); 240 MOCK_METHOD1(OnReceivedMessage, void(FilterMessage message));
241 241
242 // VideoRenderer implementation. 242 // VideoRenderer implementation.
243 MOCK_METHOD2(Initialize, void(VideoDecoder* decoder, 243 MOCK_METHOD2(Initialize, void(VideoDecoder* decoder,
244 FilterCallback* callback)); 244 FilterCallback* callback));
245 MOCK_METHOD0(HasEnded, bool());
245 246
246 protected: 247 protected:
247 virtual ~MockVideoRenderer() {} 248 virtual ~MockVideoRenderer() {}
248 249
249 private: 250 private:
250 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); 251 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer);
251 }; 252 };
252 253
253 class MockAudioRenderer : public AudioRenderer { 254 class MockAudioRenderer : public AudioRenderer {
254 public: 255 public:
255 MockAudioRenderer() {} 256 MockAudioRenderer() {}
256 257
257 // MediaFilter implementation. 258 // MediaFilter implementation.
258 MOCK_METHOD0(Stop, void()); 259 MOCK_METHOD0(Stop, void());
259 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 260 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
260 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback)); 261 MOCK_METHOD2(Seek, void(base::TimeDelta time, FilterCallback* callback));
261 MOCK_METHOD1(OnReceivedMessage, void(FilterMessage message)); 262 MOCK_METHOD1(OnReceivedMessage, void(FilterMessage message));
262 263
263 // AudioRenderer implementation. 264 // AudioRenderer implementation.
264 MOCK_METHOD2(Initialize, void(AudioDecoder* decoder, 265 MOCK_METHOD2(Initialize, void(AudioDecoder* decoder,
265 FilterCallback* callback)); 266 FilterCallback* callback));
267 MOCK_METHOD0(HasEnded, bool());
266 MOCK_METHOD1(SetVolume, void(float volume)); 268 MOCK_METHOD1(SetVolume, void(float volume));
267 269
268 protected: 270 protected:
269 virtual ~MockAudioRenderer() {} 271 virtual ~MockAudioRenderer() {}
270 272
271 private: 273 private:
272 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); 274 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer);
273 }; 275 };
274 276
275 // FilterFactory that returns canned instances of mock filters. You can set 277 // FilterFactory that returns canned instances of mock filters. You can set
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 375
374 // Helper gmock action that calls BroadcastMessage() on behalf of the provided 376 // Helper gmock action that calls BroadcastMessage() on behalf of the provided
375 // filter. 377 // filter.
376 ACTION_P2(BroadcastMessage, filter, message) { 378 ACTION_P2(BroadcastMessage, filter, message) {
377 filter->host()->BroadcastMessage(message); 379 filter->host()->BroadcastMessage(message);
378 } 380 }
379 381
380 } // namespace media 382 } // namespace media
381 383
382 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 384 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW
« no previous file with comments | « media/base/mock_filter_host.h ('k') | media/base/pipeline_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698