OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/logging.h" | |
6 #include "base/utf_string_conversions.h" | |
7 #include "content/renderer/media/mock_web_peer_connection_00_handler_client.h" | |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebICECandid
ateDescriptor.h" | |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amDescriptor.h" | |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | |
11 | |
12 namespace WebKit { | |
13 | |
14 MockWebPeerConnection00HandlerClient:: | |
15 MockWebPeerConnection00HandlerClient() | |
16 : ready_state_(ReadyStateNew), | |
17 more_to_follow_(false) { | |
18 } | |
19 | |
20 MockWebPeerConnection00HandlerClient:: | |
21 ~MockWebPeerConnection00HandlerClient() {} | |
22 | |
23 void MockWebPeerConnection00HandlerClient::didGenerateICECandidate( | |
24 const WebICECandidateDescriptor& candidate, | |
25 bool more_to_follow) { | |
26 if (candidate.isNull()) { | |
27 candidate_label_.clear(); | |
28 candidate_sdp_.clear(); | |
29 } else { | |
30 candidate_label_ = UTF16ToUTF8(candidate.label()); | |
31 candidate_sdp_ = UTF16ToUTF8(candidate.candidateLine()); | |
32 } | |
33 more_to_follow_ = more_to_follow; | |
34 } | |
35 | |
36 void MockWebPeerConnection00HandlerClient::didChangeReadyState( | |
37 ReadyState state) { | |
38 ready_state_ = state; | |
39 } | |
40 | |
41 void MockWebPeerConnection00HandlerClient::didChangeICEState(ICEState state) { | |
42 NOTIMPLEMENTED(); | |
43 } | |
44 | |
45 void MockWebPeerConnection00HandlerClient::didAddRemoteStream( | |
46 const WebMediaStreamDescriptor& stream_descriptor) { | |
47 stream_label_ = UTF16ToUTF8(stream_descriptor.label()); | |
48 } | |
49 | |
50 void MockWebPeerConnection00HandlerClient::didRemoveRemoteStream( | |
51 const WebMediaStreamDescriptor& stream_descriptor) { | |
52 DCHECK(stream_label_ == UTF16ToUTF8(stream_descriptor.label())); | |
53 stream_label_.clear(); | |
54 } | |
55 | |
56 } // namespace WebKit | |
OLD | NEW |