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 "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" | 12 #include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" |
13 | 13 |
14 class MockMediaStreamDependencyFactory; | |
15 | |
14 namespace webrtc { | 16 namespace webrtc { |
15 | 17 |
16 class MockStreamCollection; | 18 class MockStreamCollection; |
17 | 19 |
18 class MockPeerConnectionImpl : public PeerConnectionInterface { | 20 class MockPeerConnectionImpl : public PeerConnectionInterface { |
19 public: | 21 public: |
20 MockPeerConnectionImpl(); | 22 MockPeerConnectionImpl(MockMediaStreamDependencyFactory* factory); |
21 | 23 |
22 // PeerConnectionInterface implementation. | 24 // PeerConnectionInterface implementation. |
23 virtual void ProcessSignalingMessage(const std::string& msg) OVERRIDE; | 25 virtual void ProcessSignalingMessage(const std::string& msg) OVERRIDE; |
24 virtual bool Send(const std::string& msg) OVERRIDE; | 26 virtual bool Send(const std::string& msg) OVERRIDE; |
25 virtual talk_base::scoped_refptr<StreamCollectionInterface> | 27 virtual talk_base::scoped_refptr<StreamCollectionInterface> |
26 local_streams() OVERRIDE; | 28 local_streams() OVERRIDE; |
perkj_chrome
2012/04/11 12:28:19
where are local_streams() and remote_streams() imp
tommi (sloooow) - chröme
2012/04/11 15:07:43
the implementations are in the cc file. it just l
| |
27 virtual talk_base::scoped_refptr<StreamCollectionInterface> | 29 virtual talk_base::scoped_refptr<StreamCollectionInterface> |
28 remote_streams() OVERRIDE; | 30 remote_streams() OVERRIDE; |
29 virtual void AddStream(LocalMediaStreamInterface* stream) OVERRIDE; | 31 virtual void AddStream(LocalMediaStreamInterface* stream) OVERRIDE; |
30 virtual void RemoveStream(LocalMediaStreamInterface* stream) OVERRIDE; | 32 virtual void RemoveStream(LocalMediaStreamInterface* stream) OVERRIDE; |
31 virtual void CommitStreamChanges() OVERRIDE; | 33 virtual void CommitStreamChanges() OVERRIDE; |
32 virtual void Close() OVERRIDE; | 34 virtual void Close() OVERRIDE; |
33 virtual ReadyState ready_state() OVERRIDE; | 35 virtual ReadyState ready_state() OVERRIDE; |
34 virtual SdpState sdp_state() OVERRIDE; | 36 virtual SdpState sdp_state() OVERRIDE; |
35 virtual bool StartIce(IceOptions options) OVERRIDE; | 37 virtual bool StartIce(IceOptions options) OVERRIDE; |
36 | 38 |
(...skipping 10 matching lines...) Expand all Loading... | |
47 webrtc::SessionDescriptionInterface* desc) OVERRIDE; | 49 webrtc::SessionDescriptionInterface* desc) OVERRIDE; |
48 virtual bool ProcessIceMessage( | 50 virtual bool ProcessIceMessage( |
49 const webrtc::IceCandidateInterface* ice_candidate) OVERRIDE; | 51 const webrtc::IceCandidateInterface* ice_candidate) OVERRIDE; |
50 virtual const webrtc::SessionDescriptionInterface* local_description() | 52 virtual const webrtc::SessionDescriptionInterface* local_description() |
51 const OVERRIDE; | 53 const OVERRIDE; |
52 virtual const webrtc::SessionDescriptionInterface* remote_description() | 54 virtual const webrtc::SessionDescriptionInterface* remote_description() |
53 const OVERRIDE; | 55 const OVERRIDE; |
54 | 56 |
55 void AddRemoteStream(MediaStreamInterface* stream); | 57 void AddRemoteStream(MediaStreamInterface* stream); |
56 void ClearStreamChangesCommitted() { stream_changes_committed_ = false; } | 58 void ClearStreamChangesCommitted() { stream_changes_committed_ = false; } |
59 void SetReadyState(ReadyState state) { ready_state_ = state; } | |
57 | 60 |
58 const std::string& signaling_message() const { return signaling_message_; } | 61 const std::string& signaling_message() const { return signaling_message_; } |
59 const std::string& stream_label() const { return stream_label_; } | 62 const std::string& stream_label() const { return stream_label_; } |
60 bool stream_changes_committed() const { return stream_changes_committed_; } | 63 bool stream_changes_committed() const { return stream_changes_committed_; } |
64 bool hint_audio() const { return hint_audio_; } | |
65 bool hint_video() const { return hint_video_; } | |
66 Action action() const { return action_; } | |
67 const std::string& description_sdp() const { return description_sdp_; } | |
68 IceOptions ice_options() const { return ice_options_; } | |
69 const std::string& ice_label() const { return ice_label_; } | |
70 const std::string& ice_sdp() const { return ice_sdp_; } | |
71 | |
72 static const char kDummyOffer[]; | |
61 | 73 |
62 protected: | 74 protected: |
63 virtual ~MockPeerConnectionImpl(); | 75 virtual ~MockPeerConnectionImpl(); |
64 | 76 |
65 private: | 77 private: |
78 // Used for creating MockSessionDescription. | |
79 MockMediaStreamDependencyFactory* dependency_factory_; | |
80 | |
66 std::string signaling_message_; | 81 std::string signaling_message_; |
67 std::string stream_label_; | 82 std::string stream_label_; |
68 bool stream_changes_committed_; | 83 bool stream_changes_committed_; |
69 talk_base::scoped_refptr<MockStreamCollection> local_streams_; | 84 talk_base::scoped_refptr<MockStreamCollection> local_streams_; |
70 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; | 85 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; |
86 bool hint_audio_; | |
87 bool hint_video_; | |
88 Action action_; | |
89 std::string description_sdp_; | |
90 IceOptions ice_options_; | |
91 std::string ice_label_; | |
92 std::string ice_sdp_; | |
93 ReadyState ready_state_; | |
71 | 94 |
72 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); | 95 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); |
73 }; | 96 }; |
74 | 97 |
75 } // namespace webrtc | 98 } // namespace webrtc |
76 | 99 |
77 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 100 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
OLD | NEW |