OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "webrtc/api/test/fakedtlsidentitystore.h" | |
14 #include "webrtc/api/test/fakeperiodicvideocapturer.h" | 13 #include "webrtc/api/test/fakeperiodicvideocapturer.h" |
| 14 #include "webrtc/api/test/fakertccertificategenerator.h" |
15 #include "webrtc/api/test/mockpeerconnectionobservers.h" | 15 #include "webrtc/api/test/mockpeerconnectionobservers.h" |
16 #include "webrtc/api/test/peerconnectiontestwrapper.h" | 16 #include "webrtc/api/test/peerconnectiontestwrapper.h" |
17 #include "webrtc/base/gunit.h" | 17 #include "webrtc/base/gunit.h" |
18 #include "webrtc/p2p/base/fakeportallocator.h" | 18 #include "webrtc/p2p/base/fakeportallocator.h" |
19 | 19 |
20 static const char kStreamLabelBase[] = "stream_label"; | 20 static const char kStreamLabelBase[] = "stream_label"; |
21 static const char kVideoTrackLabelBase[] = "video_track"; | 21 static const char kVideoTrackLabelBase[] = "video_track"; |
22 static const char kAudioTrackLabelBase[] = "audio_track"; | 22 static const char kAudioTrackLabelBase[] = "audio_track"; |
23 static const int kMaxWait = 10000; | 23 static const int kMaxWait = 10000; |
24 static const int kTestAudioFrameCount = 3; | 24 static const int kTestAudioFrameCount = 3; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 fake_audio_capture_module_, NULL, NULL); | 72 fake_audio_capture_module_, NULL, NULL); |
73 if (!peer_connection_factory_) { | 73 if (!peer_connection_factory_) { |
74 return false; | 74 return false; |
75 } | 75 } |
76 | 76 |
77 // CreatePeerConnection with RTCConfiguration. | 77 // CreatePeerConnection with RTCConfiguration. |
78 webrtc::PeerConnectionInterface::RTCConfiguration config; | 78 webrtc::PeerConnectionInterface::RTCConfiguration config; |
79 webrtc::PeerConnectionInterface::IceServer ice_server; | 79 webrtc::PeerConnectionInterface::IceServer ice_server; |
80 ice_server.uri = "stun:stun.l.google.com:19302"; | 80 ice_server.uri = "stun:stun.l.google.com:19302"; |
81 config.servers.push_back(ice_server); | 81 config.servers.push_back(ice_server); |
82 std::unique_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store( | 82 std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator( |
83 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? new FakeDtlsIdentityStore() | 83 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? new FakeRTCCertificateGenerator() |
84 : nullptr); | 84 : nullptr); |
85 peer_connection_ = peer_connection_factory_->CreatePeerConnectionWithStore( | 85 peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
86 config, constraints, std::move(port_allocator), | 86 config, constraints, std::move(port_allocator), std::move(cert_generator), |
87 std::move(dtls_identity_store), this); | 87 this); |
88 | 88 |
89 return peer_connection_.get() != NULL; | 89 return peer_connection_.get() != NULL; |
90 } | 90 } |
91 | 91 |
92 rtc::scoped_refptr<webrtc::DataChannelInterface> | 92 rtc::scoped_refptr<webrtc::DataChannelInterface> |
93 PeerConnectionTestWrapper::CreateDataChannel( | 93 PeerConnectionTestWrapper::CreateDataChannel( |
94 const std::string& label, | 94 const std::string& label, |
95 const webrtc::DataChannelInit& init) { | 95 const webrtc::DataChannelInit& init) { |
96 return peer_connection_->CreateDataChannel(label, &init); | 96 return peer_connection_->CreateDataChannel(label, &init); |
97 } | 97 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 peer_connection_factory_->CreateVideoSource( | 276 peer_connection_factory_->CreateVideoSource( |
277 new webrtc::FakePeriodicVideoCapturer(), &constraints); | 277 new webrtc::FakePeriodicVideoCapturer(), &constraints); |
278 std::string videotrack_label = label + kVideoTrackLabelBase; | 278 std::string videotrack_label = label + kVideoTrackLabelBase; |
279 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 279 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
280 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); | 280 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); |
281 | 281 |
282 stream->AddTrack(video_track); | 282 stream->AddTrack(video_track); |
283 } | 283 } |
284 return stream; | 284 return stream; |
285 } | 285 } |
OLD | NEW |