| OLD | NEW |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_TRUE(transport_controller_->GetSslRole(&role)); |
| 266 EXPECT_EQ(rtc::SSL_CLIENT, role); | 266 EXPECT_EQ(rtc::SSL_CLIENT, role); |
| 267 } | 267 } |
| 268 | 268 |
| 269 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) { | 269 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) { |
| 270 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 = | 270 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 = |
| 271 rtc::RTCCertificate::Create( | 271 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( |
| 272 rtc::scoped_ptr<rtc::SSLIdentity>( | 272 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT))); |
| 273 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT)) | |
| 274 .Pass()); | |
| 275 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 = | 273 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 = |
| 276 rtc::RTCCertificate::Create( | 274 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( |
| 277 rtc::scoped_ptr<rtc::SSLIdentity>( | 275 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT))); |
| 278 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT)) | |
| 279 .Pass()); | |
| 280 rtc::scoped_refptr<rtc::RTCCertificate> returned_certificate; | 276 rtc::scoped_refptr<rtc::RTCCertificate> returned_certificate; |
| 281 | 277 |
| 282 FakeTransportChannel* channel1 = CreateChannel("audio", 1); | 278 FakeTransportChannel* channel1 = CreateChannel("audio", 1); |
| 283 ASSERT_NE(nullptr, channel1); | 279 ASSERT_NE(nullptr, channel1); |
| 284 | 280 |
| 285 EXPECT_TRUE(transport_controller_->SetLocalCertificate(certificate1)); | 281 EXPECT_TRUE(transport_controller_->SetLocalCertificate(certificate1)); |
| 286 EXPECT_TRUE(transport_controller_->GetLocalCertificate( | 282 EXPECT_TRUE(transport_controller_->GetLocalCertificate( |
| 287 "audio", &returned_certificate)); | 283 "audio", &returned_certificate)); |
| 288 EXPECT_EQ(certificate1->identity()->certificate().ToPEMString(), | 284 EXPECT_EQ(certificate1->identity()->certificate().ToPEMString(), |
| 289 returned_certificate->identity()->certificate().ToPEMString()); | 285 returned_certificate->identity()->certificate().ToPEMString()); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 // new --> gathering --> complete | 676 // new --> gathering --> complete |
| 681 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout); | 677 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout); |
| 682 EXPECT_EQ(2, gathering_state_signal_count_); | 678 EXPECT_EQ(2, gathering_state_signal_count_); |
| 683 | 679 |
| 684 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout); | 680 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout); |
| 685 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout); | 681 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout); |
| 686 EXPECT_EQ(2, candidates_signal_count_); | 682 EXPECT_EQ(2, candidates_signal_count_); |
| 687 | 683 |
| 688 EXPECT_TRUE(!signaled_on_non_signaling_thread_); | 684 EXPECT_TRUE(!signaled_on_non_signaling_thread_); |
| 689 } | 685 } |
| OLD | NEW |