| 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_PEER_CONNECTION_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual bool SendDtmf(const webrtc::AudioTrackInterface* send_track, | 35 virtual bool SendDtmf(const webrtc::AudioTrackInterface* send_track, |
| 36 const std::string& tones, int duration, | 36 const std::string& tones, int duration, |
| 37 const webrtc::AudioTrackInterface* play_track) OVERRIDE; | 37 const webrtc::AudioTrackInterface* play_track) OVERRIDE; |
| 38 virtual talk_base::scoped_refptr<webrtc::DataChannelInterface> | 38 virtual talk_base::scoped_refptr<webrtc::DataChannelInterface> |
| 39 CreateDataChannel(const std::string& label, | 39 CreateDataChannel(const std::string& label, |
| 40 const webrtc::DataChannelInit* config) OVERRIDE; | 40 const webrtc::DataChannelInit* config) OVERRIDE; |
| 41 | 41 |
| 42 virtual bool GetStats(webrtc::StatsObserver* observer, | 42 virtual bool GetStats(webrtc::StatsObserver* observer, |
| 43 webrtc::MediaStreamTrackInterface* track) OVERRIDE; | 43 webrtc::MediaStreamTrackInterface* track) OVERRIDE; |
| 44 virtual ReadyState ready_state() OVERRIDE; | 44 virtual ReadyState ready_state() OVERRIDE; |
| 45 virtual SignalingState signaling_state() OVERRIDE; |
| 45 virtual bool StartIce(IceOptions options) OVERRIDE; | 46 virtual bool StartIce(IceOptions options) OVERRIDE; |
| 46 | 47 |
| 47 virtual webrtc::SessionDescriptionInterface* CreateOffer( | |
| 48 const webrtc::MediaHints& hints) OVERRIDE; | |
| 49 virtual webrtc::SessionDescriptionInterface* CreateAnswer( | |
| 50 const webrtc::MediaHints& hints, | |
| 51 const webrtc::SessionDescriptionInterface* offer) OVERRIDE; | |
| 52 virtual bool SetLocalDescription( | |
| 53 Action action, | |
| 54 webrtc::SessionDescriptionInterface* desc) OVERRIDE; | |
| 55 virtual bool SetRemoteDescription( | |
| 56 Action action, | |
| 57 webrtc::SessionDescriptionInterface* desc) OVERRIDE; | |
| 58 virtual bool ProcessIceMessage( | |
| 59 const webrtc::IceCandidateInterface* ice_candidate) OVERRIDE; | |
| 60 virtual const webrtc::SessionDescriptionInterface* local_description() | 48 virtual const webrtc::SessionDescriptionInterface* local_description() |
| 61 const OVERRIDE; | 49 const OVERRIDE; |
| 62 virtual const webrtc::SessionDescriptionInterface* remote_description() | 50 virtual const webrtc::SessionDescriptionInterface* remote_description() |
| 63 const OVERRIDE; | 51 const OVERRIDE; |
| 64 | 52 |
| 65 // JSEP01 APIs | 53 // JSEP01 APIs |
| 66 virtual void CreateOffer( | 54 virtual void CreateOffer( |
| 67 webrtc::CreateSessionDescriptionObserver* observer, | 55 webrtc::CreateSessionDescriptionObserver* observer, |
| 68 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; | 56 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; |
| 69 virtual void CreateAnswer( | 57 virtual void CreateAnswer( |
| 70 webrtc::CreateSessionDescriptionObserver* observer, | 58 webrtc::CreateSessionDescriptionObserver* observer, |
| 71 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; | 59 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; |
| 72 virtual void SetLocalDescription( | 60 virtual void SetLocalDescription( |
| 73 webrtc::SetSessionDescriptionObserver* observer, | 61 webrtc::SetSessionDescriptionObserver* observer, |
| 74 webrtc::SessionDescriptionInterface* desc) OVERRIDE; | 62 webrtc::SessionDescriptionInterface* desc) OVERRIDE; |
| 75 virtual void SetRemoteDescription( | 63 virtual void SetRemoteDescription( |
| 76 webrtc::SetSessionDescriptionObserver* observer, | 64 webrtc::SetSessionDescriptionObserver* observer, |
| 77 webrtc::SessionDescriptionInterface* desc) OVERRIDE; | 65 webrtc::SessionDescriptionInterface* desc) OVERRIDE; |
| 78 virtual bool UpdateIce( | 66 virtual bool UpdateIce( |
| 79 const IceServers& configuration, | 67 const IceServers& configuration, |
| 80 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; | 68 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; |
| 81 virtual bool AddIceCandidate( | 69 virtual bool AddIceCandidate( |
| 82 const webrtc::IceCandidateInterface* candidate) OVERRIDE; | 70 const webrtc::IceCandidateInterface* candidate) OVERRIDE; |
| 83 virtual IceState ice_state() OVERRIDE; | 71 virtual IceState ice_state() OVERRIDE; |
| 84 | 72 |
| 85 void AddRemoteStream(webrtc::MediaStreamInterface* stream); | 73 void AddRemoteStream(webrtc::MediaStreamInterface* stream); |
| 86 void SetReadyState(ReadyState state) { ready_state_ = state; } | 74 void SetReadyState(ReadyState state) { signaling_state_ = state; } |
| 87 void SetIceState(IceState state) { ice_state_ = state; } | 75 void SetIceState(IceState state) { ice_state_ = state; } |
| 88 | 76 |
| 89 const std::string& stream_label() const { return stream_label_; } | 77 const std::string& stream_label() const { return stream_label_; } |
| 90 bool hint_audio() const { return hint_audio_; } | 78 bool hint_audio() const { return hint_audio_; } |
| 91 bool hint_video() const { return hint_video_; } | 79 bool hint_video() const { return hint_video_; } |
| 92 Action action() const { return action_; } | |
| 93 const std::string& description_sdp() const { return description_sdp_; } | 80 const std::string& description_sdp() const { return description_sdp_; } |
| 94 IceOptions ice_options() const { return ice_options_; } | 81 IceOptions ice_options() const { return ice_options_; } |
| 95 const std::string& sdp_mid() const { return sdp_mid_; } | 82 const std::string& sdp_mid() const { return sdp_mid_; } |
| 96 int sdp_mline_index() const { return sdp_mline_index_; } | 83 int sdp_mline_index() const { return sdp_mline_index_; } |
| 97 const std::string& ice_sdp() const { return ice_sdp_; } | 84 const std::string& ice_sdp() const { return ice_sdp_; } |
| 98 webrtc::SessionDescriptionInterface* created_session_description() const { | 85 webrtc::SessionDescriptionInterface* created_session_description() const { |
| 99 return created_sessiondescription_.get(); | 86 return created_sessiondescription_.get(); |
| 100 } | 87 } |
| 101 static const char kDummyOffer[]; | 88 static const char kDummyOffer[]; |
| 102 static const char kDummyAnswer[]; | 89 static const char kDummyAnswer[]; |
| 103 | 90 |
| 104 protected: | 91 protected: |
| 105 virtual ~MockPeerConnectionImpl(); | 92 virtual ~MockPeerConnectionImpl(); |
| 106 | 93 |
| 107 private: | 94 private: |
| 108 // Used for creating MockSessionDescription. | 95 // Used for creating MockSessionDescription. |
| 109 MockMediaStreamDependencyFactory* dependency_factory_; | 96 MockMediaStreamDependencyFactory* dependency_factory_; |
| 110 | 97 |
| 111 std::string stream_label_; | 98 std::string stream_label_; |
| 112 talk_base::scoped_refptr<MockStreamCollection> local_streams_; | 99 talk_base::scoped_refptr<MockStreamCollection> local_streams_; |
| 113 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; | 100 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; |
| 114 scoped_ptr<webrtc::SessionDescriptionInterface> local_desc_; | 101 scoped_ptr<webrtc::SessionDescriptionInterface> local_desc_; |
| 115 scoped_ptr<webrtc::SessionDescriptionInterface> remote_desc_; | 102 scoped_ptr<webrtc::SessionDescriptionInterface> remote_desc_; |
| 116 scoped_ptr<webrtc::SessionDescriptionInterface> created_sessiondescription_; | 103 scoped_ptr<webrtc::SessionDescriptionInterface> created_sessiondescription_; |
| 117 bool hint_audio_; | 104 bool hint_audio_; |
| 118 bool hint_video_; | 105 bool hint_video_; |
| 119 Action action_; | |
| 120 std::string description_sdp_; | 106 std::string description_sdp_; |
| 121 IceOptions ice_options_; | 107 IceOptions ice_options_; |
| 122 std::string sdp_mid_; | 108 std::string sdp_mid_; |
| 123 int sdp_mline_index_; | 109 int sdp_mline_index_; |
| 124 std::string ice_sdp_; | 110 std::string ice_sdp_; |
| 125 ReadyState ready_state_; | 111 SignalingState signaling_state_; |
| 126 IceState ice_state_; | 112 IceState ice_state_; |
| 127 | 113 |
| 128 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); | 114 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); |
| 129 }; | 115 }; |
| 130 | 116 |
| 131 } // namespace content | 117 } // namespace content |
| 132 | 118 |
| 133 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 119 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
| OLD | NEW |