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

Unified Diff: media/base/mock_audio_renderer_sink.cc

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/mock_audio_renderer_sink.h ('k') | media/base/output_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
+ 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
« no previous file with comments | « media/base/mock_audio_renderer_sink.h ('k') | media/base/output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698