Chromium Code Reviews| Index: media/base/mock_audio_renderer_sink.h |
| diff --git a/media/base/mock_audio_renderer_sink.h b/media/base/mock_audio_renderer_sink.h |
| index 2194bc99d926165e961540ec8bb96c53d31de64b..466673244354c3fcae8a66392ce88b926b5c487f 100644 |
| --- a/media/base/mock_audio_renderer_sink.h |
| +++ b/media/base/mock_audio_renderer_sink.h |
| @@ -16,18 +16,43 @@ namespace media { |
| class FakeOutputDevice; |
| -class MockAudioRendererSink : public RestartableAudioRendererSink { |
| +class MockAudioRendererSink : public SwitchableAudioRendererSink { |
| public: |
| + class OutputDeviceInfoFactory { |
| + public: |
| + virtual OutputDeviceInfo* NewOutputDeviceInfo( |
|
Guido Urdaneta
2016/03/22 15:30:18
Why should this return pointers?
Why a factory for
o1ka
2016/03/22 16:13:56
Ok, removing this for now.
|
| + const std::string& device_id) = 0; |
| + |
| + protected: |
| + virtual ~OutputDeviceInfoFactory() {} |
| + }; |
| + |
| MockAudioRendererSink(); |
| explicit MockAudioRendererSink(OutputDeviceStatus device_status); |
| + MockAudioRendererSink(OutputDeviceStatus device_status, |
| + const AudioParameters& device_output_params); |
| + MockAudioRendererSink(const std::string& device_id, |
| + OutputDeviceStatus device_status); |
| + MockAudioRendererSink(const std::string& device_id, |
| + OutputDeviceStatus device_status, |
| + const AudioParameters& device_output_params); |
| + |
| + // Use this constructor if you need a working implementation of |
| + // SwitchOutputDevice(). Do not pass nullptr as |device_factory|. |
| + MockAudioRendererSink(OutputDeviceInfoFactory* device_info_factory, |
| + const std::string& device_id); |
| MOCK_METHOD0(Start, void()); |
| MOCK_METHOD0(Stop, void()); |
| MOCK_METHOD0(Pause, void()); |
| MOCK_METHOD0(Play, void()); |
| MOCK_METHOD1(SetVolume, bool(double volume)); |
| - OutputDevice* GetOutputDevice(); |
| + OutputDeviceInfo GetOutputDeviceInfo(); |
| + |
| + void SwitchOutputDevice(const std::string& device_id, |
| + const url::Origin& security_origin, |
| + const OutputDeviceStatusCB& callback) override; |
| void Initialize(const AudioParameters& params, |
| RenderCallback* renderer) override; |
| AudioRendererSink::RenderCallback* callback() { return callback_; } |
| @@ -36,8 +61,9 @@ class MockAudioRendererSink : public RestartableAudioRendererSink { |
| ~MockAudioRendererSink() override; |
| private: |
| + OutputDeviceInfoFactory* device_info_factory_; |
| RenderCallback* callback_; |
| - scoped_ptr<FakeOutputDevice> output_device_; |
| + scoped_ptr<OutputDeviceInfo> output_device_info_; |
|
Guido Urdaneta
2016/03/22 15:30:18
I think this shouldn't be a pointer.
o1ka
2016/03/22 16:13:56
Done.
|
| DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink); |
| }; |