OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // FakePacketTransports. | 51 // FakePacketTransports. |
52 auto result = OrtcFactory::Create( | 52 auto result = OrtcFactory::Create( |
53 nullptr, nullptr, nullptr, nullptr, nullptr, | 53 nullptr, nullptr, nullptr, nullptr, nullptr, |
54 std::unique_ptr<cricket::MediaEngineInterface>(fake_media_engine_)); | 54 std::unique_ptr<cricket::MediaEngineInterface>(fake_media_engine_)); |
55 ortc_factory_ = result.MoveValue(); | 55 ortc_factory_ = result.MoveValue(); |
56 rtp_transport_controller_ = | 56 rtp_transport_controller_ = |
57 ortc_factory_->CreateRtpTransportController().MoveValue(); | 57 ortc_factory_->CreateRtpTransportController().MoveValue(); |
58 | 58 |
59 fake_packet_transport_.reset(new rtc::FakePacketTransport("fake")); | 59 fake_packet_transport_.reset(new rtc::FakePacketTransport("fake")); |
60 auto srtp_transport_result = ortc_factory_->CreateSrtpTransport( | 60 auto srtp_transport_result = ortc_factory_->CreateSrtpTransport( |
61 rtcp_parameters_, fake_packet_transport_.get(), nullptr, | 61 rtp_transport_parameters_, fake_packet_transport_.get(), nullptr, |
62 rtp_transport_controller_.get()); | 62 rtp_transport_controller_.get()); |
63 srtp_transport_ = srtp_transport_result.MoveValue(); | 63 srtp_transport_ = srtp_transport_result.MoveValue(); |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
67 // Owned by |ortc_factory_|. | 67 // Owned by |ortc_factory_|. |
68 cricket::FakeMediaEngine* fake_media_engine_; | 68 cricket::FakeMediaEngine* fake_media_engine_; |
69 std::unique_ptr<OrtcFactoryInterface> ortc_factory_; | 69 std::unique_ptr<OrtcFactoryInterface> ortc_factory_; |
70 std::unique_ptr<RtpTransportControllerInterface> rtp_transport_controller_; | 70 std::unique_ptr<RtpTransportControllerInterface> rtp_transport_controller_; |
71 std::unique_ptr<SrtpTransportInterface> srtp_transport_; | 71 std::unique_ptr<SrtpTransportInterface> srtp_transport_; |
72 RtcpParameters rtcp_parameters_; | 72 RtpTransportParameters rtp_transport_parameters_; |
73 std::unique_ptr<rtc::FakePacketTransport> fake_packet_transport_; | 73 std::unique_ptr<rtc::FakePacketTransport> fake_packet_transport_; |
74 }; | 74 }; |
75 | 75 |
76 // Tests that setting the SRTP send/receive key succeeds. | 76 // Tests that setting the SRTP send/receive key succeeds. |
77 TEST_F(SrtpTransportTest, SetSrtpSendAndReceiveKey) { | 77 TEST_F(SrtpTransportTest, SetSrtpSendAndReceiveKey) { |
78 EXPECT_TRUE(srtp_transport_->SetSrtpSendKey(kTestSha1CryptoParams1).ok()); | 78 EXPECT_TRUE(srtp_transport_->SetSrtpSendKey(kTestSha1CryptoParams1).ok()); |
79 EXPECT_TRUE(srtp_transport_->SetSrtpReceiveKey(kTestSha1CryptoParams2).ok()); | 79 EXPECT_TRUE(srtp_transport_->SetSrtpReceiveKey(kTestSha1CryptoParams2).ok()); |
80 auto sender_result = ortc_factory_->CreateRtpSender(cricket::MEDIA_TYPE_AUDIO, | 80 auto sender_result = ortc_factory_->CreateRtpSender(cricket::MEDIA_TYPE_AUDIO, |
81 srtp_transport_.get()); | 81 srtp_transport_.get()); |
82 EXPECT_TRUE(sender_result.ok()); | 82 EXPECT_TRUE(sender_result.ok()); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 ortc_factory_->CreateRtpReceiver(GetParam(), srtp_transport_.get()); | 158 ortc_factory_->CreateRtpReceiver(GetParam(), srtp_transport_.get()); |
159 EXPECT_TRUE(receiver_result.ok()); | 159 EXPECT_TRUE(receiver_result.ok()); |
160 } | 160 } |
161 | 161 |
162 INSTANTIATE_TEST_CASE_P(SenderCreatationTest, | 162 INSTANTIATE_TEST_CASE_P(SenderCreatationTest, |
163 SrtpTransportTestWithMediaType, | 163 SrtpTransportTestWithMediaType, |
164 ::testing::Values(cricket::MEDIA_TYPE_AUDIO, | 164 ::testing::Values(cricket::MEDIA_TYPE_AUDIO, |
165 cricket::MEDIA_TYPE_VIDEO)); | 165 cricket::MEDIA_TYPE_VIDEO)); |
166 | 166 |
167 } // namespace webrtc | 167 } // namespace webrtc |
OLD | NEW |