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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 ASSERT_TRUE(channel->SetSslRole(rtc::SSL_CLIENT)); | 253 ASSERT_TRUE(channel->SetSslRole(rtc::SSL_CLIENT)); |
254 rtc::SSLRole role; | 254 rtc::SSLRole role; |
255 EXPECT_TRUE(transport_controller_->GetSslRole(&role)); | 255 EXPECT_TRUE(transport_controller_->GetSslRole(&role)); |
256 EXPECT_EQ(rtc::SSL_CLIENT, role); | 256 EXPECT_EQ(rtc::SSL_CLIENT, role); |
257 } | 257 } |
258 | 258 |
259 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) { | 259 TEST_F(TransportControllerTest, TestSetAndGetLocalCertificate) { |
260 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 = | 260 rtc::scoped_refptr<rtc::RTCCertificate> certificate1 = |
261 rtc::RTCCertificate::Create( | 261 rtc::RTCCertificate::Create( |
262 rtc::scoped_ptr<rtc::SSLIdentity>( | 262 rtc::scoped_ptr<rtc::SSLIdentity>( |
263 rtc::SSLIdentity::Generate("session1", rtc::KT_DEFAULT)) | 263 rtc::SSLIdentity::Generate("session1", rtc::KeyTypeFull())) |
264 .Pass()); | 264 .Pass()); |
265 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 = | 265 rtc::scoped_refptr<rtc::RTCCertificate> certificate2 = |
266 rtc::RTCCertificate::Create( | 266 rtc::RTCCertificate::Create( |
267 rtc::scoped_ptr<rtc::SSLIdentity>( | 267 rtc::scoped_ptr<rtc::SSLIdentity>( |
268 rtc::SSLIdentity::Generate("session2", rtc::KT_DEFAULT)) | 268 rtc::SSLIdentity::Generate("session2", rtc::KeyTypeFull())) |
269 .Pass()); | 269 .Pass()); |
270 rtc::scoped_refptr<rtc::RTCCertificate> returned_certificate; | 270 rtc::scoped_refptr<rtc::RTCCertificate> returned_certificate; |
271 | 271 |
272 FakeTransportChannel* channel1 = CreateChannel("audio", 1); | 272 FakeTransportChannel* channel1 = CreateChannel("audio", 1); |
273 ASSERT_NE(nullptr, channel1); | 273 ASSERT_NE(nullptr, channel1); |
274 | 274 |
275 EXPECT_TRUE(transport_controller_->SetLocalCertificate(certificate1)); | 275 EXPECT_TRUE(transport_controller_->SetLocalCertificate(certificate1)); |
276 EXPECT_TRUE(transport_controller_->GetLocalCertificate( | 276 EXPECT_TRUE(transport_controller_->GetLocalCertificate( |
277 "audio", &returned_certificate)); | 277 "audio", &returned_certificate)); |
278 EXPECT_EQ(certificate1->identity()->certificate().ToPEMString(), | 278 EXPECT_EQ(certificate1->identity()->certificate().ToPEMString(), |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 // new --> gathering --> complete | 670 // new --> gathering --> complete |
671 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout); | 671 EXPECT_EQ_WAIT(cricket::kIceGatheringComplete, gathering_state_, kTimeout); |
672 EXPECT_EQ(2, gathering_state_signal_count_); | 672 EXPECT_EQ(2, gathering_state_signal_count_); |
673 | 673 |
674 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout); | 674 EXPECT_EQ_WAIT(1U, candidates_["audio"].size(), kTimeout); |
675 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout); | 675 EXPECT_EQ_WAIT(1U, candidates_["video"].size(), kTimeout); |
676 EXPECT_EQ(2, candidates_signal_count_); | 676 EXPECT_EQ(2, candidates_signal_count_); |
677 | 677 |
678 EXPECT_TRUE(!signaled_on_non_signaling_thread_); | 678 EXPECT_TRUE(!signaled_on_non_signaling_thread_); |
679 } | 679 } |
OLD | NEW |