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; |
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; |
(...skipping 16 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 const std::string kDummyOffer; | |
tommi (sloooow) - chröme
2012/03/26 12:34:45
static const char[] ?
Henrik Grunell
2012/03/27 07:22:05
Sure. Done.
| |
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> remote_streams_; | 84 talk_base::scoped_refptr<MockStreamCollection> remote_streams_; |
85 bool hint_audio_; | |
86 bool hint_video_; | |
87 Action action_; | |
88 std::string description_sdp_; | |
89 IceOptions ice_options_; | |
90 std::string ice_label_; | |
91 std::string ice_sdp_; | |
92 ReadyState ready_state_; | |
70 | 93 |
71 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); | 94 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl); |
72 }; | 95 }; |
73 | 96 |
74 } // namespace webrtc | 97 } // namespace webrtc |
75 | 98 |
76 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ | 99 #endif // CONTENT_RENDERER_MEDIA_MOCK_PEER_CONNECTION_IMPL_H_ |
OLD | NEW |