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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" | 15 #include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h
" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class MockPeerConnectionDependencyFactory; | 19 class MockPeerConnectionDependencyFactory; |
20 class MockStreamCollection; | 20 class MockStreamCollection; |
21 | 21 |
22 class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { | 22 class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface { |
23 public: | 23 public: |
24 explicit MockPeerConnectionImpl(MockPeerConnectionDependencyFactory* factory); | 24 explicit MockPeerConnectionImpl(MockPeerConnectionDependencyFactory* factory); |
25 | 25 |
26 // PeerConnectionInterface implementation. | 26 // PeerConnectionInterface implementation. |
27 virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> | 27 virtual rtc::scoped_refptr<webrtc::StreamCollectionInterface> |
28 local_streams() OVERRIDE; | 28 local_streams() OVERRIDE; |
29 virtual talk_base::scoped_refptr<webrtc::StreamCollectionInterface> | 29 virtual rtc::scoped_refptr<webrtc::StreamCollectionInterface> |
30 remote_streams() OVERRIDE; | 30 remote_streams() OVERRIDE; |
31 virtual bool AddStream( | 31 virtual bool AddStream( |
32 webrtc::MediaStreamInterface* local_stream, | 32 webrtc::MediaStreamInterface* local_stream, |
33 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; | 33 const webrtc::MediaConstraintsInterface* constraints) OVERRIDE; |
34 virtual void RemoveStream( | 34 virtual void RemoveStream( |
35 webrtc::MediaStreamInterface* local_stream) OVERRIDE; | 35 webrtc::MediaStreamInterface* local_stream) OVERRIDE; |
36 virtual talk_base::scoped_refptr<webrtc::DtmfSenderInterface> | 36 virtual rtc::scoped_refptr<webrtc::DtmfSenderInterface> |
37 CreateDtmfSender(webrtc::AudioTrackInterface* track) OVERRIDE; | 37 CreateDtmfSender(webrtc::AudioTrackInterface* track) OVERRIDE; |
38 virtual talk_base::scoped_refptr<webrtc::DataChannelInterface> | 38 virtual rtc::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) { | 43 webrtc::MediaStreamTrackInterface* track) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 virtual bool GetStats(webrtc::StatsObserver* observer, | 46 virtual bool GetStats(webrtc::StatsObserver* observer, |
47 webrtc::MediaStreamTrackInterface* track, | 47 webrtc::MediaStreamTrackInterface* track, |
48 StatsOutputLevel level) OVERRIDE; | 48 StatsOutputLevel level) OVERRIDE; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 static const char kDummyAnswer[]; | 117 static const char kDummyAnswer[]; |
118 | 118 |
119 protected: | 119 protected: |
120 virtual ~MockPeerConnectionImpl(); | 120 virtual ~MockPeerConnectionImpl(); |
121 | 121 |
122 private: | 122 private: |
123 // Used for creating MockSessionDescription. | 123 // Used for creating MockSessionDescription. |
124 MockPeerConnectionDependencyFactory* dependency_factory_; | 124 MockPeerConnectionDependencyFactory* dependency_factory_; |
125 | 125 |
126 std::string stream_label_; | 126 std::string stream_label_; |
127 talk_base::scoped_refptr<MockStreamCollection> local_streams_; | 127 rtc::scoped_refptr<MockStreamCollection> local_streams_; |
128 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; | 128 rtc::scoped_refptr<MockStreamCollection> remote_streams_; |
129 scoped_ptr<webrtc::SessionDescriptionInterface> local_desc_; | 129 scoped_ptr<webrtc::SessionDescriptionInterface> local_desc_; |
130 scoped_ptr<webrtc::SessionDescriptionInterface> remote_desc_; | 130 scoped_ptr<webrtc::SessionDescriptionInterface> remote_desc_; |
131 scoped_ptr<webrtc::SessionDescriptionInterface> created_sessiondescription_; | 131 scoped_ptr<webrtc::SessionDescriptionInterface> created_sessiondescription_; |
132 bool hint_audio_; | 132 bool hint_audio_; |
133 bool hint_video_; | 133 bool hint_video_; |
134 bool getstats_result_; | 134 bool getstats_result_; |
135 std::string description_sdp_; | 135 std::string description_sdp_; |
136 std::string sdp_mid_; | 136 std::string sdp_mid_; |
137 int sdp_mline_index_; | 137 int sdp_mline_index_; |
138 std::string ice_sdp_; | 138 std::string ice_sdp_; |
139 | 139 |
140 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); | 140 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); |
141 }; | 141 }; |
142 | 142 |
143 } // namespace content | 143 } // namespace content |
144 | 144 |
145 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 145 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
OLD | NEW |