| 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 CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/renderer/media/media_stream_dispatcher.h" | 10 #include "content/renderer/media/media_stream_dispatcher.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // This class is a mock implementation of MediaStreamDispatcher. | 15 // This class is a mock implementation of MediaStreamDispatcher. |
| 16 class MockMediaStreamDispatcher : public MediaStreamDispatcher { | 16 class MockMediaStreamDispatcher : public MediaStreamDispatcher { |
| 17 public: | 17 public: |
| 18 MockMediaStreamDispatcher(); | 18 MockMediaStreamDispatcher(); |
| 19 virtual ~MockMediaStreamDispatcher(); | 19 ~MockMediaStreamDispatcher() override; |
| 20 | 20 |
| 21 virtual void GenerateStream( | 21 void GenerateStream( |
| 22 int request_id, | 22 int request_id, |
| 23 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, | 23 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, |
| 24 const StreamOptions& components, | 24 const StreamOptions& components, |
| 25 const GURL& url) override; | 25 const GURL& url) override; |
| 26 virtual void CancelGenerateStream( | 26 void CancelGenerateStream( |
| 27 int request_id, | 27 int request_id, |
| 28 const base::WeakPtr<MediaStreamDispatcherEventHandler>& | 28 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler) |
| 29 event_handler) override; | 29 override; |
| 30 virtual void EnumerateDevices( | 30 void EnumerateDevices( |
| 31 int request_id, | 31 int request_id, |
| 32 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, | 32 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, |
| 33 MediaStreamType type, | 33 MediaStreamType type, |
| 34 const GURL& security_origin) override; | 34 const GURL& security_origin) override; |
| 35 virtual void StopStreamDevice(const StreamDeviceInfo& device_info) override; | 35 void StopStreamDevice(const StreamDeviceInfo& device_info) override; |
| 36 virtual bool IsStream(const std::string& label) override; | 36 bool IsStream(const std::string& label) override; |
| 37 virtual int video_session_id(const std::string& label, int index) override; | 37 int video_session_id(const std::string& label, int index) override; |
| 38 virtual int audio_session_id(const std::string& label, int index) override; | 38 int audio_session_id(const std::string& label, int index) override; |
| 39 | 39 |
| 40 int audio_input_request_id() const { return audio_input_request_id_; } | 40 int audio_input_request_id() const { return audio_input_request_id_; } |
| 41 int audio_output_request_id() const { return audio_output_request_id_; } | 41 int audio_output_request_id() const { return audio_output_request_id_; } |
| 42 int video_request_id() const { return video_request_id_; } | 42 int video_request_id() const { return video_request_id_; } |
| 43 int request_stream_counter() const { return request_stream_counter_; } | 43 int request_stream_counter() const { return request_stream_counter_; } |
| 44 void IncrementSessionId() { ++session_id_; } | 44 void IncrementSessionId() { ++session_id_; } |
| 45 | 45 |
| 46 int stop_audio_device_counter() const { return stop_audio_device_counter_; } | 46 int stop_audio_device_counter() const { return stop_audio_device_counter_; } |
| 47 int stop_video_device_counter() const { return stop_video_device_counter_; } | 47 int stop_video_device_counter() const { return stop_video_device_counter_; } |
| 48 | 48 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 StreamDeviceInfoArray audio_input_array_; | 73 StreamDeviceInfoArray audio_input_array_; |
| 74 StreamDeviceInfoArray audio_output_array_; | 74 StreamDeviceInfoArray audio_output_array_; |
| 75 StreamDeviceInfoArray video_array_; | 75 StreamDeviceInfoArray video_array_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); | 77 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 } // namespace content | 80 } // namespace content |
| 81 | 81 |
| 82 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ | 82 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ |
| OLD | NEW |