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