Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: content/renderer/media/mock_web_rtc_peer_connection_handler_client.cc

Issue 2972003002: RTCPeerConnection.ontrack event added. (Closed)
Patch Set: Le merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" 4 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
5 5
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "third_party/WebKit/public/platform/WebMediaStream.h" 8 #include "third_party/WebKit/public/platform/WebMediaStream.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 10
11 using testing::_; 11 using testing::_;
12 12
13 namespace content { 13 namespace content {
14 14
15 MockWebRTCPeerConnectionHandlerClient:: 15 MockWebRTCPeerConnectionHandlerClient::
16 MockWebRTCPeerConnectionHandlerClient() 16 MockWebRTCPeerConnectionHandlerClient()
17 : candidate_mline_index_(-1) { 17 : candidate_mline_index_(-1) {
18 ON_CALL(*this, DidGenerateICECandidate(_)) 18 ON_CALL(*this, DidGenerateICECandidate(_))
19 .WillByDefault( 19 .WillByDefault(
20 testing::Invoke(this, &MockWebRTCPeerConnectionHandlerClient:: 20 testing::Invoke(this, &MockWebRTCPeerConnectionHandlerClient::
21 didGenerateICECandidateWorker)); 21 didGenerateICECandidateWorker));
22 ON_CALL(*this, DidAddRemoteStream(_)) 22 ON_CALL(*this, DidAddRemoteStream(_, _))
23 .WillByDefault(testing::Invoke( 23 .WillByDefault(testing::Invoke(
24 this, 24 this,
25 &MockWebRTCPeerConnectionHandlerClient::didAddRemoteStreamWorker)); 25 &MockWebRTCPeerConnectionHandlerClient::didAddRemoteStreamWorker));
26 ON_CALL(*this, DidRemoveRemoteStream(_)) 26 ON_CALL(*this, DidRemoveRemoteStream(_))
27 .WillByDefault(testing::Invoke( 27 .WillByDefault(testing::Invoke(
28 this, 28 this,
29 &MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStreamWorker)); 29 &MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStreamWorker));
30 } 30 }
31 31
32 MockWebRTCPeerConnectionHandlerClient:: 32 MockWebRTCPeerConnectionHandlerClient::
33 ~MockWebRTCPeerConnectionHandlerClient() {} 33 ~MockWebRTCPeerConnectionHandlerClient() {}
34 34
35 void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker( 35 void MockWebRTCPeerConnectionHandlerClient::didGenerateICECandidateWorker(
36 const blink::WebRTCICECandidate& candidate) { 36 const blink::WebRTCICECandidate& candidate) {
37 if (!candidate.IsNull()) { 37 if (!candidate.IsNull()) {
38 candidate_sdp_ = candidate.Candidate().Utf8(); 38 candidate_sdp_ = candidate.Candidate().Utf8();
39 candidate_mline_index_ = candidate.SdpMLineIndex(); 39 candidate_mline_index_ = candidate.SdpMLineIndex();
40 candidate_mid_ = candidate.SdpMid().Utf8(); 40 candidate_mid_ = candidate.SdpMid().Utf8();
41 } else { 41 } else {
42 candidate_sdp_ = ""; 42 candidate_sdp_ = "";
43 candidate_mline_index_ = -1; 43 candidate_mline_index_ = -1;
44 candidate_mid_ = ""; 44 candidate_mid_ = "";
45 } 45 }
46 } 46 }
47 47
48 void MockWebRTCPeerConnectionHandlerClient::didAddRemoteStreamWorker( 48 void MockWebRTCPeerConnectionHandlerClient::didAddRemoteStreamWorker(
49 const blink::WebMediaStream& stream_descriptor) { 49 const blink::WebMediaStream& stream_descriptor,
50 blink::WebVector<std::unique_ptr<blink::WebRTCRtpReceiver>>*
51 stream_web_rtp_receivers) {
50 remote_steam_ = stream_descriptor; 52 remote_steam_ = stream_descriptor;
51 } 53 }
52 54
53 void MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStreamWorker( 55 void MockWebRTCPeerConnectionHandlerClient::didRemoveRemoteStreamWorker(
54 const blink::WebMediaStream& stream_descriptor) { 56 const blink::WebMediaStream& stream_descriptor) {
55 remote_steam_.Reset(); 57 remote_steam_.Reset();
56 } 58 }
57 59
58 } // namespace content 60 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698