OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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, |
11 * this list of conditions and the following disclaimer in the documentation | 11 * this list of conditions and the following disclaimer in the documentation |
12 * and/or other materials provided with the distribution. | 12 * and/or other materials provided with the distribution. |
13 * 3. The name of the author may not be used to endorse or promote products | 13 * 3. The name of the author may not be used to endorse or promote products |
14 * derived from this software without specific prior written permission. | 14 * derived from this software without specific prior written permission. |
15 * | 15 * |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #include "talk/app/webrtc/fakeportallocatorfactory.h" | 28 #include "talk/app/webrtc/fakeportallocatorfactory.h" |
29 #include "talk/app/webrtc/test/fakedtlsidentityservice.h" | 29 #include "talk/app/webrtc/test/fakedtlsidentitystore.h" |
30 #include "talk/app/webrtc/test/fakeperiodicvideocapturer.h" | 30 #include "talk/app/webrtc/test/fakeperiodicvideocapturer.h" |
31 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" | 31 #include "talk/app/webrtc/test/mockpeerconnectionobservers.h" |
32 #include "talk/app/webrtc/test/peerconnectiontestwrapper.h" | 32 #include "talk/app/webrtc/test/peerconnectiontestwrapper.h" |
33 #include "talk/app/webrtc/videosourceinterface.h" | 33 #include "talk/app/webrtc/videosourceinterface.h" |
34 #include "webrtc/base/gunit.h" | 34 #include "webrtc/base/gunit.h" |
35 | 35 |
36 static const char kStreamLabelBase[] = "stream_label"; | 36 static const char kStreamLabelBase[] = "stream_label"; |
37 static const char kVideoTrackLabelBase[] = "video_track"; | 37 static const char kVideoTrackLabelBase[] = "video_track"; |
38 static const char kAudioTrackLabelBase[] = "audio_track"; | 38 static const char kAudioTrackLabelBase[] = "audio_track"; |
39 static const int kMaxWait = 10000; | 39 static const int kMaxWait = 10000; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 fake_audio_capture_module_, NULL, NULL); | 86 fake_audio_capture_module_, NULL, NULL); |
87 if (!peer_connection_factory_) { | 87 if (!peer_connection_factory_) { |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 // CreatePeerConnection with IceServers. | 91 // CreatePeerConnection with IceServers. |
92 webrtc::PeerConnectionInterface::IceServers ice_servers; | 92 webrtc::PeerConnectionInterface::IceServers ice_servers; |
93 webrtc::PeerConnectionInterface::IceServer ice_server; | 93 webrtc::PeerConnectionInterface::IceServer ice_server; |
94 ice_server.uri = "stun:stun.l.google.com:19302"; | 94 ice_server.uri = "stun:stun.l.google.com:19302"; |
95 ice_servers.push_back(ice_server); | 95 ice_servers.push_back(ice_server); |
96 FakeIdentityService* dtls_service = | 96 dtls_identity_store_.reset( |
97 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? | 97 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? |
98 new FakeIdentityService() : NULL; | 98 new FakeDtlsIdentityStore() : nullptr); |
99 peer_connection_ = peer_connection_factory_->CreatePeerConnection( | 99 peer_connection_ = peer_connection_factory_->CreatePeerConnection( |
100 ice_servers, constraints, allocator_factory_.get(), dtls_service, this); | 100 ice_servers, constraints, allocator_factory_.get(), |
| 101 dtls_identity_store_.get(), this); |
101 | 102 |
102 return peer_connection_.get() != NULL; | 103 return peer_connection_.get() != NULL; |
103 } | 104 } |
104 | 105 |
105 rtc::scoped_refptr<webrtc::DataChannelInterface> | 106 rtc::scoped_refptr<webrtc::DataChannelInterface> |
106 PeerConnectionTestWrapper::CreateDataChannel( | 107 PeerConnectionTestWrapper::CreateDataChannel( |
107 const std::string& label, | 108 const std::string& label, |
108 const webrtc::DataChannelInit& init) { | 109 const webrtc::DataChannelInit& init) { |
109 return peer_connection_->CreateDataChannel(label, &init); | 110 return peer_connection_->CreateDataChannel(label, &init); |
110 } | 111 } |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 peer_connection_factory_->CreateVideoSource( | 289 peer_connection_factory_->CreateVideoSource( |
289 new webrtc::FakePeriodicVideoCapturer(), &constraints); | 290 new webrtc::FakePeriodicVideoCapturer(), &constraints); |
290 std::string videotrack_label = label + kVideoTrackLabelBase; | 291 std::string videotrack_label = label + kVideoTrackLabelBase; |
291 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 292 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
292 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); | 293 peer_connection_factory_->CreateVideoTrack(videotrack_label, source)); |
293 | 294 |
294 stream->AddTrack(video_track); | 295 stream->AddTrack(video_track); |
295 } | 296 } |
296 return stream; | 297 return stream; |
297 } | 298 } |
OLD | NEW |