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_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(OutputDeviceStatus device_status, |
| 24 const AudioParameters& device_output_params); |
| 25 MockAudioRendererSink(const std::string& device_id, |
| 26 OutputDeviceStatus device_status); |
| 27 MockAudioRendererSink(const std::string& device_id, |
| 28 OutputDeviceStatus device_status, |
| 29 const AudioParameters& device_output_params); |
23 | 30 |
24 MOCK_METHOD0(Start, void()); | 31 MOCK_METHOD0(Start, void()); |
25 MOCK_METHOD0(Stop, void()); | 32 MOCK_METHOD0(Stop, void()); |
26 MOCK_METHOD0(Pause, void()); | 33 MOCK_METHOD0(Pause, void()); |
27 MOCK_METHOD0(Play, void()); | 34 MOCK_METHOD0(Play, void()); |
28 MOCK_METHOD1(SetVolume, bool(double volume)); | 35 MOCK_METHOD1(SetVolume, bool(double volume)); |
29 OutputDevice* GetOutputDevice(); | |
30 | 36 |
| 37 OutputDeviceInfo GetOutputDeviceInfo(); |
| 38 |
| 39 void SwitchOutputDevice(const std::string& device_id, |
| 40 const url::Origin& security_origin, |
| 41 const OutputDeviceStatusCB& callback) override; |
31 void Initialize(const AudioParameters& params, | 42 void Initialize(const AudioParameters& params, |
32 RenderCallback* renderer) override; | 43 RenderCallback* renderer) override; |
33 AudioRendererSink::RenderCallback* callback() { return callback_; } | 44 AudioRendererSink::RenderCallback* callback() { return callback_; } |
34 | 45 |
35 protected: | 46 protected: |
36 ~MockAudioRendererSink() override; | 47 ~MockAudioRendererSink() override; |
37 | 48 |
38 private: | 49 private: |
39 RenderCallback* callback_; | 50 RenderCallback* callback_; |
40 scoped_ptr<FakeOutputDevice> output_device_; | 51 OutputDeviceInfo output_device_info_; |
41 | 52 |
42 DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink); | 53 DISALLOW_COPY_AND_ASSIGN(MockAudioRendererSink); |
43 }; | 54 }; |
44 | 55 |
45 } // namespace media | 56 } // namespace media |
46 | 57 |
47 #endif // MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_ | 58 #endif // MEDIA_BASE_MOCK_AUDIO_RENDERER_SINK_H_ |
OLD | NEW |