| OLD | NEW |
| 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 #ifndef MEDIA_BASE_MOCK_FILTERS_H_ | 5 #ifndef MEDIA_BASE_MOCK_FILTERS_H_ |
| 6 #define MEDIA_BASE_MOCK_FILTERS_H_ | 6 #define MEDIA_BASE_MOCK_FILTERS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Note: Start() and Resume() declarations are not actually overrides; they | 60 // Note: Start() and Resume() declarations are not actually overrides; they |
| 61 // take unique_ptr* instead of unique_ptr so that they can be mock methods. | 61 // take unique_ptr* instead of unique_ptr so that they can be mock methods. |
| 62 // Private stubs for Start() and Resume() implement the actual Pipeline | 62 // Private stubs for Start() and Resume() implement the actual Pipeline |
| 63 // interface by forwarding to these mock methods. | 63 // interface by forwarding to these mock methods. |
| 64 MOCK_METHOD4(Start, | 64 MOCK_METHOD4(Start, |
| 65 void(Demuxer*, | 65 void(Demuxer*, |
| 66 std::unique_ptr<Renderer>*, | 66 std::unique_ptr<Renderer>*, |
| 67 Client*, | 67 Client*, |
| 68 const PipelineStatusCB&)); | 68 const PipelineStatusCB&)); |
| 69 MOCK_METHOD0(Stop, void()); | 69 MOCK_METHOD0(Stop, void()); |
| 70 MOCK_METHOD2(RestartStreamPlayback, |
| 71 void(DemuxerStream* stream, base::TimeDelta time)); |
| 70 MOCK_METHOD2(Seek, void(base::TimeDelta, const PipelineStatusCB&)); | 72 MOCK_METHOD2(Seek, void(base::TimeDelta, const PipelineStatusCB&)); |
| 71 MOCK_METHOD1(Suspend, void(const PipelineStatusCB&)); | 73 MOCK_METHOD1(Suspend, void(const PipelineStatusCB&)); |
| 72 MOCK_METHOD3(Resume, | 74 MOCK_METHOD3(Resume, |
| 73 void(std::unique_ptr<Renderer>*, | 75 void(std::unique_ptr<Renderer>*, |
| 74 base::TimeDelta, | 76 base::TimeDelta, |
| 75 const PipelineStatusCB&)); | 77 const PipelineStatusCB&)); |
| 76 | 78 |
| 77 // TODO(sandersd): This should automatically return true between Start() and | 79 // TODO(sandersd): This should automatically return true between Start() and |
| 78 // Stop(). (Or better, remove it from the interface entirely.) | 80 // Stop(). (Or better, remove it from the interface entirely.) |
| 79 MOCK_CONST_METHOD0(IsRunning, bool()); | 81 MOCK_CONST_METHOD0(IsRunning, bool()); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 AudioDecoderConfig audio_decoder_config() override; | 146 AudioDecoderConfig audio_decoder_config() override; |
| 145 VideoDecoderConfig video_decoder_config() override; | 147 VideoDecoderConfig video_decoder_config() override; |
| 146 MOCK_METHOD0(EnableBitstreamConverter, void()); | 148 MOCK_METHOD0(EnableBitstreamConverter, void()); |
| 147 MOCK_METHOD0(SupportsConfigChanges, bool()); | 149 MOCK_METHOD0(SupportsConfigChanges, bool()); |
| 148 | 150 |
| 149 void set_audio_decoder_config(const AudioDecoderConfig& config); | 151 void set_audio_decoder_config(const AudioDecoderConfig& config); |
| 150 void set_video_decoder_config(const VideoDecoderConfig& config); | 152 void set_video_decoder_config(const VideoDecoderConfig& config); |
| 151 void set_liveness(Liveness liveness); | 153 void set_liveness(Liveness liveness); |
| 152 | 154 |
| 153 VideoRotation video_rotation() override; | 155 VideoRotation video_rotation() override; |
| 156 MOCK_CONST_METHOD0(enabled, bool()); |
| 157 MOCK_METHOD2(set_enabled, void(bool, base::TimeDelta)); |
| 154 | 158 |
| 155 private: | 159 private: |
| 156 Type type_; | 160 Type type_; |
| 157 Liveness liveness_; | 161 Liveness liveness_; |
| 158 AudioDecoderConfig audio_decoder_config_; | 162 AudioDecoderConfig audio_decoder_config_; |
| 159 VideoDecoderConfig video_decoder_config_; | 163 VideoDecoderConfig video_decoder_config_; |
| 160 | 164 |
| 161 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); | 165 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); |
| 162 }; | 166 }; |
| 163 | 167 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 MockRenderer(); | 269 MockRenderer(); |
| 266 virtual ~MockRenderer(); | 270 virtual ~MockRenderer(); |
| 267 | 271 |
| 268 // Renderer implementation. | 272 // Renderer implementation. |
| 269 MOCK_METHOD3(Initialize, | 273 MOCK_METHOD3(Initialize, |
| 270 void(DemuxerStreamProvider* demuxer_stream_provider, | 274 void(DemuxerStreamProvider* demuxer_stream_provider, |
| 271 RendererClient* client, | 275 RendererClient* client, |
| 272 const PipelineStatusCB& init_cb)); | 276 const PipelineStatusCB& init_cb)); |
| 273 MOCK_METHOD1(Flush, void(const base::Closure& flush_cb)); | 277 MOCK_METHOD1(Flush, void(const base::Closure& flush_cb)); |
| 274 MOCK_METHOD1(StartPlayingFrom, void(base::TimeDelta timestamp)); | 278 MOCK_METHOD1(StartPlayingFrom, void(base::TimeDelta timestamp)); |
| 279 MOCK_METHOD2(RestartStreamPlayback, |
| 280 void(DemuxerStream* stream, base::TimeDelta time)); |
| 275 MOCK_METHOD1(SetPlaybackRate, void(double playback_rate)); | 281 MOCK_METHOD1(SetPlaybackRate, void(double playback_rate)); |
| 276 MOCK_METHOD1(SetVolume, void(float volume)); | 282 MOCK_METHOD1(SetVolume, void(float volume)); |
| 277 MOCK_METHOD0(GetMediaTime, base::TimeDelta()); | 283 MOCK_METHOD0(GetMediaTime, base::TimeDelta()); |
| 278 MOCK_METHOD0(HasAudio, bool()); | 284 MOCK_METHOD0(HasAudio, bool()); |
| 279 MOCK_METHOD0(HasVideo, bool()); | 285 MOCK_METHOD0(HasVideo, bool()); |
| 280 MOCK_METHOD2(SetCdm, | 286 MOCK_METHOD2(SetCdm, |
| 281 void(CdmContext* cdm_context, | 287 void(CdmContext* cdm_context, |
| 282 const CdmAttachedCB& cdm_attached_cb)); | 288 const CdmAttachedCB& cdm_attached_cb)); |
| 283 | 289 |
| 284 private: | 290 private: |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 MOCK_METHOD0(GetDecryptor, Decryptor*()); | 363 MOCK_METHOD0(GetDecryptor, Decryptor*()); |
| 358 int GetCdmId() const override; | 364 int GetCdmId() const override; |
| 359 | 365 |
| 360 private: | 366 private: |
| 361 DISALLOW_COPY_AND_ASSIGN(MockCdmContext); | 367 DISALLOW_COPY_AND_ASSIGN(MockCdmContext); |
| 362 }; | 368 }; |
| 363 | 369 |
| 364 } // namespace media | 370 } // namespace media |
| 365 | 371 |
| 366 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 372 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |