| 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 "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 12 | 12 |
| 13 // This class is a mock implementation of MediaStreamDispatcher. | 13 // This class is a mock implementation of MediaStreamDispatcher. |
| 14 class MockMediaStreamDispatcher : public MediaStreamDispatcher { | 14 class MockMediaStreamDispatcher : public MediaStreamDispatcher { |
| 15 public: | 15 public: |
| 16 MockMediaStreamDispatcher(); | 16 MockMediaStreamDispatcher(); |
| 17 virtual ~MockMediaStreamDispatcher(); | 17 virtual ~MockMediaStreamDispatcher(); |
| 18 | 18 |
| 19 virtual void GenerateStream( | 19 virtual void GenerateStream( |
| 20 int request_id, | 20 int request_id, |
| 21 const base::WeakPtr<MediaStreamDispatcherEventHandler>&, | 21 const base::WeakPtr<MediaStreamDispatcherEventHandler>&, |
| 22 media_stream::StreamOptions components, | 22 media_stream::StreamOptions components, |
| 23 const GURL&) OVERRIDE; | 23 const GURL&) OVERRIDE; |
| 24 virtual void GenerateStreamForDevice( |
| 25 int request_id, |
| 26 const base::WeakPtr<MediaStreamDispatcherEventHandler>&, |
| 27 media_stream::StreamOptions components, |
| 28 const std::string& device_id, |
| 29 const GURL&) OVERRIDE; |
| 24 virtual void StopStream(const std::string& label) OVERRIDE; | 30 virtual void StopStream(const std::string& label) OVERRIDE; |
| 25 virtual bool IsStream(const std::string& label) OVERRIDE; | 31 virtual bool IsStream(const std::string& label) OVERRIDE; |
| 26 virtual int video_session_id(const std::string& label, int index) OVERRIDE; | 32 virtual int video_session_id(const std::string& label, int index) OVERRIDE; |
| 27 virtual int audio_session_id(const std::string& label, int index) OVERRIDE; | 33 virtual int audio_session_id(const std::string& label, int index) OVERRIDE; |
| 28 | 34 |
| 29 int request_id() const { return request_id_; } | 35 int request_id() const { return request_id_; } |
| 30 int stop_stream_counter() const { return stop_stream_counter_; } | 36 int stop_stream_counter() const { return stop_stream_counter_; } |
| 31 const std::string& stream_label() const { return stream_label_;} | 37 const std::string& stream_label() const { return stream_label_;} |
| 32 media_stream::StreamDeviceInfoArray audio_array() const { | 38 media_stream::StreamDeviceInfoArray audio_array() const { |
| 33 return audio_array_; | 39 return audio_array_; |
| 34 } | 40 } |
| 35 media_stream::StreamDeviceInfoArray video_array() const { | 41 media_stream::StreamDeviceInfoArray video_array() const { |
| 36 return video_array_; | 42 return video_array_; |
| 37 } | 43 } |
| 38 | 44 |
| 39 private: | 45 private: |
| 40 int request_id_; | 46 int request_id_; |
| 41 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_; | 47 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_; |
| 42 int stop_stream_counter_; | 48 int stop_stream_counter_; |
| 43 | 49 |
| 44 std::string stream_label_; | 50 std::string stream_label_; |
| 45 media_stream::StreamDeviceInfoArray audio_array_; | 51 media_stream::StreamDeviceInfoArray audio_array_; |
| 46 media_stream::StreamDeviceInfoArray video_array_; | 52 media_stream::StreamDeviceInfoArray video_array_; |
| 47 | 53 |
| 48 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); | 54 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); |
| 49 }; | 55 }; |
| 50 | 56 |
| 51 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ | 57 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ |
| OLD | NEW |