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

Side by Side Diff: webrtc/p2p/base/transportcontroller_unittest.cc

Issue 1516993002: Properly handle different transports having different SSL roles. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing merge conflicts. Created 4 years, 11 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 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 channel1->SignalRoleConflict(channel1); 255 channel1->SignalRoleConflict(channel1);
256 EXPECT_EQ(cricket::ICEROLE_CONTROLLED, channel1->GetIceRole()); 256 EXPECT_EQ(cricket::ICEROLE_CONTROLLED, channel1->GetIceRole());
257 EXPECT_EQ(cricket::ICEROLE_CONTROLLED, channel2->GetIceRole()); 257 EXPECT_EQ(cricket::ICEROLE_CONTROLLED, channel2->GetIceRole());
258 } 258 }
259 259
260 TEST_F(TransportControllerTest, TestGetSslRole) { 260 TEST_F(TransportControllerTest, TestGetSslRole) {
261 FakeTransportChannel* channel = CreateChannel("audio", 1); 261 FakeTransportChannel* channel = CreateChannel("audio", 1);
262 ASSERT_NE(nullptr, channel); 262 ASSERT_NE(nullptr, channel);
263 ASSERT_TRUE(channel->SetSslRole(rtc::SSL_CLIENT)); 263 ASSERT_TRUE(channel->SetSslRole(rtc::SSL_CLIENT));
264 rtc::SSLRole role; 264 rtc::SSLRole role;
265 EXPECT_TRUE(transport_controller_->GetSslRole(&role)); 265 EXPECT_FALSE(transport_controller_->GetSslRole("video", &role));
266 EXPECT_TRUE(transport_controller_->GetSslRole("audio", &role));
266 EXPECT_EQ(rtc::SSL_CLIENT, role); 267 EXPECT_EQ(rtc::SSL_CLIENT, role);
267 } 268 }
268 269
269 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) { 270 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) {
270 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 = 271 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 =
271 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( 272 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
272 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT))); 273 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT)));
273 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 = 274 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 =
274 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( 275 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
275 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT))); 276 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT)));
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 // new --> gathering --> complete 677 // new --> gathering --> complete
677 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout); 678 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout);
678 EXPECT_EQ(2, gathering_state_signal_count_); 679 EXPECT_EQ(2, gathering_state_signal_count_);
679 680
680 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout); 681 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout);
681 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout); 682 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout);
682 EXPECT_EQ(2, candidates_signal_count_); 683 EXPECT_EQ(2, candidates_signal_count_);
683 684
684 EXPECT_TRUE(!signaled_on_non_signaling_thread_); 685 EXPECT_TRUE(!signaled_on_non_signaling_thread_);
685 } 686 }
OLDNEW
« talk/session/media/mediasession.h ('K') | « webrtc/p2p/base/transportcontroller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698