Chromium Code Reviews| Index: media/base/mock_audio_renderer_sink.cc |
| diff --git a/media/base/mock_audio_renderer_sink.cc b/media/base/mock_audio_renderer_sink.cc |
| index 79653b2f8232c2b0688a9ec95232101495530d9b..5785ee4225451e7b669e976412277c71eb596cdd 100644 |
| --- a/media/base/mock_audio_renderer_sink.cc |
| +++ b/media/base/mock_audio_renderer_sink.cc |
| @@ -3,24 +3,49 @@ |
| // found in the LICENSE file. |
| #include "media/base/mock_audio_renderer_sink.h" |
| -#include "media/base/fake_output_device.h" |
| namespace media { |
| MockAudioRendererSink::MockAudioRendererSink() |
| : MockAudioRendererSink(OUTPUT_DEVICE_STATUS_OK) {} |
| MockAudioRendererSink::MockAudioRendererSink(OutputDeviceStatus device_status) |
| - : output_device_(new FakeOutputDevice(device_status)) {} |
| + : MockAudioRendererSink(std::string(), device_status) {} |
| + |
| +MockAudioRendererSink::MockAudioRendererSink(const std::string& device_id, |
|
Henrik Grunell
2016/03/25 10:44:40
There seems to be one missing ctor?
o1ka
2016/03/29 13:39:54
Removed it from the header.
|
| + OutputDeviceStatus device_status) |
| + : MockAudioRendererSink( |
| + device_id, |
| + device_status, |
| + media::AudioParameters(media::AudioParameters::AUDIO_FAKE, |
| + media::CHANNEL_LAYOUT_STEREO, |
| + media::AudioParameters::kTelephoneSampleRate, |
| + 16, |
| + 1)) {} |
| + |
| +MockAudioRendererSink::MockAudioRendererSink( |
| + const std::string& device_id, |
| + OutputDeviceStatus device_status, |
| + const AudioParameters& device_output_params) |
| + : output_device_info_(device_id, device_status, device_output_params) {} |
| MockAudioRendererSink::~MockAudioRendererSink() {} |
| +void MockAudioRendererSink::SwitchOutputDevice( |
| + const std::string& device_id, |
| + const url::Origin& security_origin, |
| + const OutputDeviceStatusCB& callback) { |
| + // NB: output device won't be changed, since it's not required by any tests |
| + // now. |
| + callback.Run(output_device_info_.device_status()); |
| +} |
| + |
| void MockAudioRendererSink::Initialize(const AudioParameters& params, |
| RenderCallback* renderer) { |
| callback_ = renderer; |
| } |
| -OutputDevice* MockAudioRendererSink::GetOutputDevice() { |
| - return output_device_.get(); |
| +OutputDeviceInfo MockAudioRendererSink::GetOutputDeviceInfo() { |
| + return output_device_info_; |
| } |
| } // namespace media |