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

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

Issue 2511633002: Rename "updateICE" to "setConfiguration", everywhere except in Blink. (Closed)
Patch Set: Making sure updateIce doesn't change behavior in this CL. Created 4 years, 1 month 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 4
5 #include "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 void(RTCPeerConnectionHandler* pc_handler, 142 void(RTCPeerConnectionHandler* pc_handler,
143 const blink::WebMediaConstraints& constraints)); 143 const blink::WebMediaConstraints& constraints));
144 MOCK_METHOD2(TrackCreateAnswer, 144 MOCK_METHOD2(TrackCreateAnswer,
145 void(RTCPeerConnectionHandler* pc_handler, 145 void(RTCPeerConnectionHandler* pc_handler,
146 const blink::WebMediaConstraints& constraints)); 146 const blink::WebMediaConstraints& constraints));
147 MOCK_METHOD4(TrackSetSessionDescription, 147 MOCK_METHOD4(TrackSetSessionDescription,
148 void(RTCPeerConnectionHandler* pc_handler, 148 void(RTCPeerConnectionHandler* pc_handler,
149 const std::string& sdp, const std::string& type, 149 const std::string& sdp, const std::string& type,
150 Source source)); 150 Source source));
151 MOCK_METHOD2( 151 MOCK_METHOD2(
152 TrackUpdateIce, 152 TrackSetConfiguration,
153 void(RTCPeerConnectionHandler* pc_handler, 153 void(RTCPeerConnectionHandler* pc_handler,
154 const webrtc::PeerConnectionInterface::RTCConfiguration& config)); 154 const webrtc::PeerConnectionInterface::RTCConfiguration& config));
155 MOCK_METHOD4(TrackAddIceCandidate, 155 MOCK_METHOD4(TrackAddIceCandidate,
156 void(RTCPeerConnectionHandler* pc_handler, 156 void(RTCPeerConnectionHandler* pc_handler,
157 const blink::WebRTCICECandidate& candidate, 157 const blink::WebRTCICECandidate& candidate,
158 Source source, 158 Source source,
159 bool succeeded)); 159 bool succeeded));
160 MOCK_METHOD3(TrackAddStream, 160 MOCK_METHOD3(TrackAddStream,
161 void(RTCPeerConnectionHandler* pc_handler, 161 void(RTCPeerConnectionHandler* pc_handler,
162 const blink::WebMediaStream& stream, 162 const blink::WebMediaStream& stream,
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 EXPECT_EQ(description.type(), pc_handler_->remoteDescription().type()); 499 EXPECT_EQ(description.type(), pc_handler_->remoteDescription().type());
500 EXPECT_EQ(description.sdp(), pc_handler_->remoteDescription().sdp()); 500 EXPECT_EQ(description.sdp(), pc_handler_->remoteDescription().sdp());
501 501
502 std::string sdp_string; 502 std::string sdp_string;
503 ASSERT_TRUE(mock_peer_connection_->remote_description() != NULL); 503 ASSERT_TRUE(mock_peer_connection_->remote_description() != NULL);
504 EXPECT_EQ(kDummySdpType, mock_peer_connection_->remote_description()->type()); 504 EXPECT_EQ(kDummySdpType, mock_peer_connection_->remote_description()->type());
505 mock_peer_connection_->remote_description()->ToString(&sdp_string); 505 mock_peer_connection_->remote_description()->ToString(&sdp_string);
506 EXPECT_EQ(kDummySdp, sdp_string); 506 EXPECT_EQ(kDummySdp, sdp_string);
507 } 507 }
508 508
509 TEST_F(RTCPeerConnectionHandlerTest, updateICE) { 509 TEST_F(RTCPeerConnectionHandlerTest, setConfiguration) {
510 blink::WebRTCConfiguration config; 510 blink::WebRTCConfiguration config;
511 511
512 EXPECT_CALL(*mock_tracker_.get(), TrackUpdateIce(pc_handler_.get(), _)); 512 EXPECT_CALL(*mock_tracker_.get(),
513 TrackSetConfiguration(pc_handler_.get(), _));
513 // TODO(perkj): Test that the parameters in |config| can be translated when a 514 // TODO(perkj): Test that the parameters in |config| can be translated when a
514 // WebRTCConfiguration can be constructed. It's WebKit class and can't be 515 // WebRTCConfiguration can be constructed. It's WebKit class and can't be
515 // initialized from a test. 516 // initialized from a test.
516 EXPECT_TRUE(pc_handler_->updateICE(config)); 517 EXPECT_TRUE(pc_handler_->setConfiguration(config));
517 } 518 }
518 519
519 TEST_F(RTCPeerConnectionHandlerTest, addICECandidate) { 520 TEST_F(RTCPeerConnectionHandlerTest, addICECandidate) {
520 blink::WebRTCICECandidate candidate; 521 blink::WebRTCICECandidate candidate;
521 candidate.initialize(kDummySdp, "sdpMid", 1); 522 candidate.initialize(kDummySdp, "sdpMid", 1);
522 523
523 EXPECT_CALL(*mock_tracker_.get(), 524 EXPECT_CALL(*mock_tracker_.get(),
524 TrackAddIceCandidate(pc_handler_.get(), 525 TrackAddIceCandidate(pc_handler_.get(),
525 testing::Ref(candidate), 526 testing::Ref(candidate),
526 PeerConnectionTracker::SOURCE_REMOTE, 527 PeerConnectionTracker::SOURCE_REMOTE,
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 testing::Ref(tracks[0]))); 1214 testing::Ref(tracks[0])));
1214 1215
1215 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender( 1216 std::unique_ptr<blink::WebRTCDTMFSenderHandler> sender(
1216 pc_handler_->createDTMFSender(tracks[0])); 1217 pc_handler_->createDTMFSender(tracks[0]));
1217 EXPECT_TRUE(sender.get()); 1218 EXPECT_TRUE(sender.get());
1218 1219
1219 StopAllTracks(local_stream); 1220 StopAllTracks(local_stream);
1220 } 1221 }
1221 1222
1222 } // namespace content 1223 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698