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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 Client*, | 66 Client*, |
67 const PipelineStatusCB&)); | 67 const PipelineStatusCB&)); |
68 MOCK_METHOD0(Stop, void()); | 68 MOCK_METHOD0(Stop, void()); |
69 MOCK_METHOD2(Seek, void(base::TimeDelta, const PipelineStatusCB&)); | 69 MOCK_METHOD2(Seek, void(base::TimeDelta, const PipelineStatusCB&)); |
70 MOCK_METHOD1(Suspend, void(const PipelineStatusCB&)); | 70 MOCK_METHOD1(Suspend, void(const PipelineStatusCB&)); |
71 MOCK_METHOD3(Resume, | 71 MOCK_METHOD3(Resume, |
72 void(std::unique_ptr<Renderer>*, | 72 void(std::unique_ptr<Renderer>*, |
73 base::TimeDelta, | 73 base::TimeDelta, |
74 const PipelineStatusCB&)); | 74 const PipelineStatusCB&)); |
75 | 75 |
| 76 MOCK_METHOD1(OnEnabledAudioTracksChanged, |
| 77 void(const std::vector<MediaTrack::Id>&)); |
| 78 MOCK_METHOD1(OnSelectedVideoTrackChanged, |
| 79 void(const std::vector<MediaTrack::Id>&)); |
| 80 |
76 // TODO(sandersd): This should automatically return true between Start() and | 81 // TODO(sandersd): This should automatically return true between Start() and |
77 // Stop(). (Or better, remove it from the interface entirely.) | 82 // Stop(). (Or better, remove it from the interface entirely.) |
78 MOCK_CONST_METHOD0(IsRunning, bool()); | 83 MOCK_CONST_METHOD0(IsRunning, bool()); |
79 | 84 |
80 // TODO(sandersd): These should be regular getters/setters. | 85 // TODO(sandersd): These should be regular getters/setters. |
81 MOCK_CONST_METHOD0(GetPlaybackRate, double()); | 86 MOCK_CONST_METHOD0(GetPlaybackRate, double()); |
82 MOCK_METHOD1(SetPlaybackRate, void(double)); | 87 MOCK_METHOD1(SetPlaybackRate, void(double)); |
83 MOCK_CONST_METHOD0(GetVolume, float()); | 88 MOCK_CONST_METHOD0(GetVolume, float()); |
84 MOCK_METHOD1(SetVolume, void(float)); | 89 MOCK_METHOD1(SetVolume, void(float)); |
85 | 90 |
(...skipping 29 matching lines...) Expand all Loading... |
115 MOCK_METHOD3(Initialize, | 120 MOCK_METHOD3(Initialize, |
116 void(DemuxerHost* host, const PipelineStatusCB& cb, bool)); | 121 void(DemuxerHost* host, const PipelineStatusCB& cb, bool)); |
117 MOCK_METHOD1(StartWaitingForSeek, void(base::TimeDelta)); | 122 MOCK_METHOD1(StartWaitingForSeek, void(base::TimeDelta)); |
118 MOCK_METHOD1(CancelPendingSeek, void(base::TimeDelta)); | 123 MOCK_METHOD1(CancelPendingSeek, void(base::TimeDelta)); |
119 MOCK_METHOD2(Seek, void(base::TimeDelta time, const PipelineStatusCB& cb)); | 124 MOCK_METHOD2(Seek, void(base::TimeDelta time, const PipelineStatusCB& cb)); |
120 MOCK_METHOD0(Stop, void()); | 125 MOCK_METHOD0(Stop, void()); |
121 MOCK_METHOD1(GetStream, DemuxerStream*(DemuxerStream::Type)); | 126 MOCK_METHOD1(GetStream, DemuxerStream*(DemuxerStream::Type)); |
122 MOCK_CONST_METHOD0(GetStartTime, base::TimeDelta()); | 127 MOCK_CONST_METHOD0(GetStartTime, base::TimeDelta()); |
123 MOCK_CONST_METHOD0(GetTimelineOffset, base::Time()); | 128 MOCK_CONST_METHOD0(GetTimelineOffset, base::Time()); |
124 MOCK_CONST_METHOD0(GetMemoryUsage, int64_t()); | 129 MOCK_CONST_METHOD0(GetMemoryUsage, int64_t()); |
| 130 MOCK_METHOD2(OnEnabledAudioTracksChanged, |
| 131 void(const std::vector<MediaTrack::Id>&, base::TimeDelta)); |
| 132 MOCK_METHOD2(OnSelectedVideoTrackChanged, |
| 133 void(const std::vector<MediaTrack::Id>&, base::TimeDelta)); |
125 | 134 |
126 private: | 135 private: |
127 DISALLOW_COPY_AND_ASSIGN(MockDemuxer); | 136 DISALLOW_COPY_AND_ASSIGN(MockDemuxer); |
128 }; | 137 }; |
129 | 138 |
130 class MockDemuxerStream : public DemuxerStream { | 139 class MockDemuxerStream : public DemuxerStream { |
131 public: | 140 public: |
132 explicit MockDemuxerStream(DemuxerStream::Type type); | 141 explicit MockDemuxerStream(DemuxerStream::Type type); |
133 virtual ~MockDemuxerStream(); | 142 virtual ~MockDemuxerStream(); |
134 | 143 |
135 // DemuxerStream implementation. | 144 // DemuxerStream implementation. |
136 Type type() const override; | 145 Type type() const override; |
137 Liveness liveness() const override; | 146 Liveness liveness() const override; |
138 MOCK_METHOD1(Read, void(const ReadCB& read_cb)); | 147 MOCK_METHOD1(Read, void(const ReadCB& read_cb)); |
139 AudioDecoderConfig audio_decoder_config() override; | 148 AudioDecoderConfig audio_decoder_config() override; |
140 VideoDecoderConfig video_decoder_config() override; | 149 VideoDecoderConfig video_decoder_config() override; |
141 MOCK_METHOD0(EnableBitstreamConverter, void()); | 150 MOCK_METHOD0(EnableBitstreamConverter, void()); |
142 MOCK_METHOD0(SupportsConfigChanges, bool()); | 151 MOCK_METHOD0(SupportsConfigChanges, bool()); |
143 | 152 |
144 void set_audio_decoder_config(const AudioDecoderConfig& config); | 153 void set_audio_decoder_config(const AudioDecoderConfig& config); |
145 void set_video_decoder_config(const VideoDecoderConfig& config); | 154 void set_video_decoder_config(const VideoDecoderConfig& config); |
146 void set_liveness(Liveness liveness); | 155 void set_liveness(Liveness liveness); |
147 | 156 |
148 VideoRotation video_rotation() override; | 157 VideoRotation video_rotation() override; |
| 158 MOCK_CONST_METHOD0(enabled, bool()); |
| 159 MOCK_METHOD2(set_enabled, void(bool, base::TimeDelta)); |
| 160 MOCK_METHOD1(SetStreamRestartedCB, void(const StreamRestartedCB&)); |
149 | 161 |
150 private: | 162 private: |
151 Type type_; | 163 Type type_; |
152 Liveness liveness_; | 164 Liveness liveness_; |
153 AudioDecoderConfig audio_decoder_config_; | 165 AudioDecoderConfig audio_decoder_config_; |
154 VideoDecoderConfig video_decoder_config_; | 166 VideoDecoderConfig video_decoder_config_; |
155 | 167 |
156 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); | 168 DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); |
157 }; | 169 }; |
158 | 170 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 368 |
357 private: | 369 private: |
358 int cdm_id_ = CdmContext::kInvalidCdmId; | 370 int cdm_id_ = CdmContext::kInvalidCdmId; |
359 | 371 |
360 DISALLOW_COPY_AND_ASSIGN(MockCdmContext); | 372 DISALLOW_COPY_AND_ASSIGN(MockCdmContext); |
361 }; | 373 }; |
362 | 374 |
363 } // namespace media | 375 } // namespace media |
364 | 376 |
365 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 377 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
OLD | NEW |