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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 webrtc::SessionDescriptionInterface* desc)); | 85 webrtc::SessionDescriptionInterface* desc)); |
86 void SetLocalDescriptionWorker( | 86 void SetLocalDescriptionWorker( |
87 webrtc::SetSessionDescriptionObserver* observer, | 87 webrtc::SetSessionDescriptionObserver* observer, |
88 webrtc::SessionDescriptionInterface* desc) ; | 88 webrtc::SessionDescriptionInterface* desc) ; |
89 MOCK_METHOD2(SetRemoteDescription, | 89 MOCK_METHOD2(SetRemoteDescription, |
90 void(webrtc::SetSessionDescriptionObserver* observer, | 90 void(webrtc::SetSessionDescriptionObserver* observer, |
91 webrtc::SessionDescriptionInterface* desc)); | 91 webrtc::SessionDescriptionInterface* desc)); |
92 void SetRemoteDescriptionWorker( | 92 void SetRemoteDescriptionWorker( |
93 webrtc::SetSessionDescriptionObserver* observer, | 93 webrtc::SetSessionDescriptionObserver* observer, |
94 webrtc::SessionDescriptionInterface* desc); | 94 webrtc::SessionDescriptionInterface* desc); |
95 bool SetConfiguration(const RTCConfiguration& configuration) override; | 95 bool SetConfiguration(const RTCConfiguration& configuration, |
| 96 webrtc::RTCError* error) override; |
96 bool AddIceCandidate(const webrtc::IceCandidateInterface* candidate) override; | 97 bool AddIceCandidate(const webrtc::IceCandidateInterface* candidate) override; |
97 void RegisterUMAObserver(webrtc::UMAObserver* observer) override; | 98 void RegisterUMAObserver(webrtc::UMAObserver* observer) override; |
98 | 99 |
99 void AddRemoteStream(webrtc::MediaStreamInterface* stream); | 100 void AddRemoteStream(webrtc::MediaStreamInterface* stream); |
100 | 101 |
101 const std::string& stream_label() const { return stream_label_; } | 102 const std::string& stream_label() const { return stream_label_; } |
102 bool hint_audio() const { return hint_audio_; } | 103 bool hint_audio() const { return hint_audio_; } |
103 bool hint_video() const { return hint_video_; } | 104 bool hint_video() const { return hint_video_; } |
104 const std::string& description_sdp() const { return description_sdp_; } | 105 const std::string& description_sdp() const { return description_sdp_; } |
105 const std::string& sdp_mid() const { return sdp_mid_; } | 106 const std::string& sdp_mid() const { return sdp_mid_; } |
106 int sdp_mline_index() const { return sdp_mline_index_; } | 107 int sdp_mline_index() const { return sdp_mline_index_; } |
107 const std::string& ice_sdp() const { return ice_sdp_; } | 108 const std::string& ice_sdp() const { return ice_sdp_; } |
108 webrtc::SessionDescriptionInterface* created_session_description() const { | 109 webrtc::SessionDescriptionInterface* created_session_description() const { |
109 return created_sessiondescription_.get(); | 110 return created_sessiondescription_.get(); |
110 } | 111 } |
111 webrtc::PeerConnectionObserver* observer() { | 112 webrtc::PeerConnectionObserver* observer() { |
112 return observer_; | 113 return observer_; |
113 } | 114 } |
| 115 void set_setconfiguration_error_type(webrtc::RTCErrorType error_type) { |
| 116 setconfiguration_error_type_ = error_type; |
| 117 } |
114 static const char kDummyOffer[]; | 118 static const char kDummyOffer[]; |
115 static const char kDummyAnswer[]; | 119 static const char kDummyAnswer[]; |
116 | 120 |
117 protected: | 121 protected: |
118 virtual ~MockPeerConnectionImpl(); | 122 virtual ~MockPeerConnectionImpl(); |
119 | 123 |
120 private: | 124 private: |
121 // Used for creating MockSessionDescription. | 125 // Used for creating MockSessionDescription. |
122 MockPeerConnectionDependencyFactory* dependency_factory_; | 126 MockPeerConnectionDependencyFactory* dependency_factory_; |
123 | 127 |
124 std::string stream_label_; | 128 std::string stream_label_; |
125 rtc::scoped_refptr<MockStreamCollection> local_streams_; | 129 rtc::scoped_refptr<MockStreamCollection> local_streams_; |
126 rtc::scoped_refptr<MockStreamCollection> remote_streams_; | 130 rtc::scoped_refptr<MockStreamCollection> remote_streams_; |
127 std::unique_ptr<webrtc::SessionDescriptionInterface> local_desc_; | 131 std::unique_ptr<webrtc::SessionDescriptionInterface> local_desc_; |
128 std::unique_ptr<webrtc::SessionDescriptionInterface> remote_desc_; | 132 std::unique_ptr<webrtc::SessionDescriptionInterface> remote_desc_; |
129 std::unique_ptr<webrtc::SessionDescriptionInterface> | 133 std::unique_ptr<webrtc::SessionDescriptionInterface> |
130 created_sessiondescription_; | 134 created_sessiondescription_; |
131 bool hint_audio_; | 135 bool hint_audio_; |
132 bool hint_video_; | 136 bool hint_video_; |
133 bool getstats_result_; | 137 bool getstats_result_; |
134 std::string description_sdp_; | 138 std::string description_sdp_; |
135 std::string sdp_mid_; | 139 std::string sdp_mid_; |
136 int sdp_mline_index_; | 140 int sdp_mline_index_; |
137 std::string ice_sdp_; | 141 std::string ice_sdp_; |
138 webrtc::PeerConnectionObserver* observer_; | 142 webrtc::PeerConnectionObserver* observer_; |
| 143 webrtc::RTCErrorType setconfiguration_error_type_ = |
| 144 webrtc::RTCErrorType::NONE; |
139 rtc::scoped_refptr<webrtc::RTCStatsReport> stats_report_; | 145 rtc::scoped_refptr<webrtc::RTCStatsReport> stats_report_; |
140 | 146 |
141 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); | 147 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); |
142 }; | 148 }; |
143 | 149 |
144 } // namespace content | 150 } // namespace content |
145 | 151 |
146 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 152 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
OLD | NEW |