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

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

Issue 10836167: Move VideoDecoder initialization into VideoRendererBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 private: 131 private:
132 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); 132 DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder);
133 }; 133 };
134 134
135 class MockVideoRenderer : public VideoRenderer { 135 class MockVideoRenderer : public VideoRenderer {
136 public: 136 public:
137 MockVideoRenderer(); 137 MockVideoRenderer();
138 138
139 // VideoRenderer implementation. 139 // VideoRenderer implementation.
140 MOCK_METHOD9(Initialize, void(const scoped_refptr<VideoDecoder>& decoder, 140 MOCK_METHOD10(Initialize, void(const scoped_refptr<DemuxerStream>& stream,
141 const PipelineStatusCB& init_cb, 141 const VideoDecoderList& decoders,
142 const StatisticsCB& statistics_cb, 142 const PipelineStatusCB& init_cb,
143 const TimeCB& time_cb, 143 const StatisticsCB& statistics_cb,
144 const NaturalSizeChangedCB& size_changed_cb, 144 const TimeCB& time_cb,
145 const base::Closure& ended_cb, 145 const NaturalSizeChangedCB& size_changed_cb,
146 const PipelineStatusCB& error_cb, 146 const base::Closure& ended_cb,
147 const TimeDeltaCB& get_time_cb, 147 const PipelineStatusCB& error_cb,
148 const TimeDeltaCB& get_duration_cb)); 148 const TimeDeltaCB& get_time_cb,
149 const TimeDeltaCB& get_duration_cb));
149 MOCK_METHOD1(Play, void(const base::Closure& callback)); 150 MOCK_METHOD1(Play, void(const base::Closure& callback));
150 MOCK_METHOD1(Pause, void(const base::Closure& callback)); 151 MOCK_METHOD1(Pause, void(const base::Closure& callback));
151 MOCK_METHOD1(Flush, void(const base::Closure& callback)); 152 MOCK_METHOD1(Flush, void(const base::Closure& callback));
152 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); 153 MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb));
153 MOCK_METHOD1(Stop, void(const base::Closure& callback)); 154 MOCK_METHOD1(Stop, void(const base::Closure& callback));
154 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); 155 MOCK_METHOD1(SetPlaybackRate, void(float playback_rate));
155 MOCK_METHOD0(HasEnded, bool()); 156 MOCK_METHOD0(HasEnded, bool());
157 MOCK_METHOD0(PrepareForShutdownHack, void());
Ami GONE FROM CHROMIUM 2012/08/09 20:30:18 Do you really need this?
acolwell GONE FROM CHROMIUM 2012/08/09 22:23:32 Yes. It is part of the VideoRenderer interface. :/
156 158
157 protected: 159 protected:
158 virtual ~MockVideoRenderer(); 160 virtual ~MockVideoRenderer();
159 161
160 private: 162 private:
161 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); 163 DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer);
162 }; 164 };
163 165
164 class MockAudioRenderer : public AudioRenderer { 166 class MockAudioRenderer : public AudioRenderer {
165 public: 167 public:
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 public: 292 public:
291 MockStatisticsCB(); 293 MockStatisticsCB();
292 ~MockStatisticsCB(); 294 ~MockStatisticsCB();
293 295
294 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); 296 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
295 }; 297 };
296 298
297 } // namespace media 299 } // namespace media
298 300
299 #endif // MEDIA_BASE_MOCK_FILTERS_H_ 301 #endif // MEDIA_BASE_MOCK_FILTERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698