OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 video_content->protocol()); | 555 video_content->protocol()); |
556 } | 556 } |
557 } | 557 } |
558 | 558 |
559 // Set the internal fake description factories to do DTLS-SRTP. | 559 // Set the internal fake description factories to do DTLS-SRTP. |
560 void SetFactoryDtlsSrtp() { | 560 void SetFactoryDtlsSrtp() { |
561 desc_factory_->set_secure(cricket::SEC_DISABLED); | 561 desc_factory_->set_secure(cricket::SEC_DISABLED); |
562 std::string identity_name = "WebRTC" + | 562 std::string identity_name = "WebRTC" + |
563 rtc::ToString(rtc::CreateRandomId()); | 563 rtc::ToString(rtc::CreateRandomId()); |
564 // Confirmed to work with KT_RSA and KT_ECDSA. | 564 // Confirmed to work with KT_RSA and KT_ECDSA. |
565 identity_.reset(rtc::SSLIdentity::Generate(identity_name, rtc::KT_DEFAULT)); | 565 tdesc_factory_->set_certificate(rtc::RTCCertificate::Create( |
566 tdesc_factory_->set_identity(identity_.get()); | 566 rtc::scoped_ptr<rtc::SSLIdentity>(rtc::SSLIdentity::Generate( |
| 567 identity_name, rtc::KT_DEFAULT)).Pass())); |
567 tdesc_factory_->set_secure(cricket::SEC_REQUIRED); | 568 tdesc_factory_->set_secure(cricket::SEC_REQUIRED); |
568 } | 569 } |
569 | 570 |
570 void VerifyFingerprintStatus(const cricket::SessionDescription* sdp, | 571 void VerifyFingerprintStatus(const cricket::SessionDescription* sdp, |
571 bool expected) { | 572 bool expected) { |
572 const TransportInfo* audio = sdp->GetTransportInfoByName("audio"); | 573 const TransportInfo* audio = sdp->GetTransportInfoByName("audio"); |
573 ASSERT_TRUE(audio != NULL); | 574 ASSERT_TRUE(audio != NULL); |
574 ASSERT_EQ(expected, audio->description.identity_fingerprint.get() != NULL); | 575 ASSERT_EQ(expected, audio->description.identity_fingerprint.get() != NULL); |
575 const TransportInfo* video = sdp->GetTransportInfoByName("video"); | 576 const TransportInfo* video = sdp->GetTransportInfoByName("video"); |
576 ASSERT_TRUE(video != NULL); | 577 ASSERT_TRUE(video != NULL); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 allocator_->AddRelay(relay_server); | 1268 allocator_->AddRelay(relay_server); |
1268 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1269 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1269 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); | 1270 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1270 } | 1271 } |
1271 | 1272 |
1272 cricket::FakeMediaEngine* media_engine_; | 1273 cricket::FakeMediaEngine* media_engine_; |
1273 cricket::FakeDataEngine* data_engine_; | 1274 cricket::FakeDataEngine* data_engine_; |
1274 cricket::FakeDeviceManager* device_manager_; | 1275 cricket::FakeDeviceManager* device_manager_; |
1275 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 1276 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
1276 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; | 1277 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; |
1277 rtc::scoped_ptr<rtc::SSLIdentity> identity_; | |
1278 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; | 1278 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; |
1279 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; | 1279 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; |
1280 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; | 1280 rtc::scoped_ptr<rtc::VirtualSocketServer> vss_; |
1281 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; | 1281 rtc::scoped_ptr<rtc::FirewallSocketServer> fss_; |
1282 rtc::SocketServerScope ss_scope_; | 1282 rtc::SocketServerScope ss_scope_; |
1283 rtc::SocketAddress stun_socket_addr_; | 1283 rtc::SocketAddress stun_socket_addr_; |
1284 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; | 1284 rtc::scoped_ptr<cricket::TestStunServer> stun_server_; |
1285 cricket::TestTurnServer turn_server_; | 1285 cricket::TestTurnServer turn_server_; |
1286 rtc::FakeNetworkManager network_manager_; | 1286 rtc::FakeNetworkManager network_manager_; |
1287 rtc::scoped_ptr<cricket::BasicPortAllocator> allocator_; | 1287 rtc::scoped_ptr<cricket::BasicPortAllocator> allocator_; |
(...skipping 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3938 } | 3938 } |
3939 } | 3939 } |
3940 | 3940 |
3941 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 3941 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
3942 // currently fails because upon disconnection and reconnection OnIceComplete is | 3942 // currently fails because upon disconnection and reconnection OnIceComplete is |
3943 // called more than once without returning to IceGatheringGathering. | 3943 // called more than once without returning to IceGatheringGathering. |
3944 | 3944 |
3945 INSTANTIATE_TEST_CASE_P( | 3945 INSTANTIATE_TEST_CASE_P( |
3946 WebRtcSessionTests, WebRtcSessionTest, | 3946 WebRtcSessionTests, WebRtcSessionTest, |
3947 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE)); | 3947 testing::Values(ALREADY_GENERATED, DTLS_IDENTITY_STORE)); |
OLD | NEW |