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

Side by Side Diff: media/base/mock_audio_renderer_sink.h

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, 8 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 unified diff | Download patch
« no previous file with comments | « media/base/fake_output_device.cc ('k') | media/base/mock_audio_renderer_sink.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_AUDIO_RENDERER_SINK_H_ 5 #ifndef MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_ 6 #define MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "media/audio/audio_parameters.h" 11 #include "media/audio/audio_parameters.h"
12 #include "media/base/audio_renderer_sink.h" 12 #include "media/base/audio_renderer_sink.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 class FakeOutputDevice; 17 class FakeOutputDevice;
18 18
19 class MockAudioRendererSink : public RestartableAudioRendererSink { 19 class MockAudioRendererSink : public SwitchableAudioRendererSink {
20 public: 20 public:
21 MockAudioRendererSink(); 21 MockAudioRendererSink();
22 explicit MockAudioRendererSink(OutputDeviceStatus device_status); 22 explicit MockAudioRendererSink(OutputDeviceStatus device_status);
23 MockAudioRendererSink(const std::string& device_id,
24 OutputDeviceStatus device_status);
25 MockAudioRendererSink(const std::string& device_id,
26 OutputDeviceStatus device_status,
27 const AudioParameters& device_output_params);
23 28
24 MOCK_METHOD0(Start, void()); 29 MOCK_METHOD0(Start, void());
25 MOCK_METHOD0(Stop, void()); 30 MOCK_METHOD0(Stop, void());
26 MOCK_METHOD0(Pause, void()); 31 MOCK_METHOD0(Pause, void());
27 MOCK_METHOD0(Play, void()); 32 MOCK_METHOD0(Play, void());
28 MOCK_METHOD1(SetVolume, bool(double volume)); 33 MOCK_METHOD1(SetVolume, bool(double volume));
29 OutputDevice* GetOutputDevice();
30 34
35 OutputDeviceInfo GetOutputDeviceInfo();
36
37 void SwitchOutputDevice(const std::string& device_id,
38 const url::Origin& security_origin,
39 const OutputDeviceStatusCB& callback) override;
31 void Initialize(const AudioParameters& params, 40 void Initialize(const AudioParameters& params,
32 RenderCallback* renderer) override; 41 RenderCallback* renderer) override;
33 AudioRendererSink::RenderCallback* callback() { return callback_; } 42 AudioRendererSink::RenderCallback* callback() { return callback_; }
34 43
35 protected: 44 protected:
36 ~MockAudioRendererSink() override; 45 ~MockAudioRendererSink() override;
37 46
38 private: 47 private:
39 RenderCallback* callback_; 48 RenderCallback* callback_;
40 scoped_ptr<FakeOutputDevice> output_device_; 49 OutputDeviceInfo output_device_info_;
41 50
42 DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink); 51 DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink);
43 }; 52 };
44 53
45 } // namespace media 54 } // namespace media
46 55
47 #endif // MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_ 56 #endif // MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_
OLDNEW
« no previous file with comments | « media/base/fake_output_device.cc ('k') | media/base/mock_audio_renderer_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698