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