OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 std::vector<cricket::Candidate> mline_0_candidates_; | 201 std::vector<cricket::Candidate> mline_0_candidates_; |
202 std::vector<cricket::Candidate> mline_1_candidates_; | 202 std::vector<cricket::Candidate> mline_1_candidates_; |
203 PeerConnectionInterface::IceConnectionState ice_connection_state_; | 203 PeerConnectionInterface::IceConnectionState ice_connection_state_; |
204 PeerConnectionInterface::IceGatheringState ice_gathering_state_; | 204 PeerConnectionInterface::IceGatheringState ice_gathering_state_; |
205 size_t num_candidates_removed_ = 0; | 205 size_t num_candidates_removed_ = 0; |
206 }; | 206 }; |
207 | 207 |
208 class WebRtcSessionForTest : public webrtc::WebRtcSession { | 208 class WebRtcSessionForTest : public webrtc::WebRtcSession { |
209 public: | 209 public: |
210 WebRtcSessionForTest(webrtc::MediaControllerInterface* media_controller, | 210 WebRtcSessionForTest(webrtc::MediaControllerInterface* media_controller, |
| 211 rtc::Thread* network_thread, |
| 212 rtc::Thread* worker_thread, |
211 rtc::Thread* signaling_thread, | 213 rtc::Thread* signaling_thread, |
212 rtc::Thread* worker_thread, | |
213 cricket::PortAllocator* port_allocator, | 214 cricket::PortAllocator* port_allocator, |
214 webrtc::IceObserver* ice_observer) | 215 webrtc::IceObserver* ice_observer) |
215 : WebRtcSession(media_controller, | 216 : WebRtcSession(media_controller, |
| 217 network_thread, |
| 218 worker_thread, |
216 signaling_thread, | 219 signaling_thread, |
217 worker_thread, | |
218 port_allocator) { | 220 port_allocator) { |
219 RegisterIceObserver(ice_observer); | 221 RegisterIceObserver(ice_observer); |
220 } | 222 } |
221 virtual ~WebRtcSessionForTest() {} | 223 virtual ~WebRtcSessionForTest() {} |
222 | 224 |
223 // Note that these methods are only safe to use if the signaling thread | 225 // Note that these methods are only safe to use if the signaling thread |
224 // is the same as the worker thread | 226 // is the same as the worker thread |
225 cricket::TransportChannel* voice_rtp_transport_channel() { | 227 cricket::TransportChannel* voice_rtp_transport_channel() { |
226 return rtp_transport_channel(voice_channel()); | 228 return rtp_transport_channel(voice_channel()); |
227 } | 229 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // If |dtls_identity_store| != null or |rtc_configuration| contains | 376 // If |dtls_identity_store| != null or |rtc_configuration| contains |
375 // |certificates| then DTLS will be enabled unless explicitly disabled by | 377 // |certificates| then DTLS will be enabled unless explicitly disabled by |
376 // |rtc_configuration| options. When DTLS is enabled a certificate will be | 378 // |rtc_configuration| options. When DTLS is enabled a certificate will be |
377 // used if provided, otherwise one will be generated using the | 379 // used if provided, otherwise one will be generated using the |
378 // |dtls_identity_store|. | 380 // |dtls_identity_store|. |
379 void Init( | 381 void Init( |
380 std::unique_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store) { | 382 std::unique_ptr<webrtc::DtlsIdentityStoreInterface> dtls_identity_store) { |
381 ASSERT_TRUE(session_.get() == NULL); | 383 ASSERT_TRUE(session_.get() == NULL); |
382 session_.reset(new WebRtcSessionForTest( | 384 session_.reset(new WebRtcSessionForTest( |
383 media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(), | 385 media_controller_.get(), rtc::Thread::Current(), rtc::Thread::Current(), |
384 allocator_.get(), &observer_)); | 386 rtc::Thread::Current(), allocator_.get(), &observer_)); |
385 session_->SignalDataChannelOpenMessage.connect( | 387 session_->SignalDataChannelOpenMessage.connect( |
386 this, &WebRtcSessionTest::OnDataChannelOpenMessage); | 388 this, &WebRtcSessionTest::OnDataChannelOpenMessage); |
387 session_->GetOnDestroyedSignal()->connect( | 389 session_->GetOnDestroyedSignal()->connect( |
388 this, &WebRtcSessionTest::OnSessionDestroyed); | 390 this, &WebRtcSessionTest::OnSessionDestroyed); |
389 | 391 |
390 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, | 392 EXPECT_EQ(PeerConnectionInterface::kIceConnectionNew, |
391 observer_.ice_connection_state_); | 393 observer_.ice_connection_state_); |
392 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, | 394 EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, |
393 observer_.ice_gathering_state_); | 395 observer_.ice_gathering_state_); |
394 | 396 |
(...skipping 3963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4358 } | 4360 } |
4359 | 4361 |
4360 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4362 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
4361 // currently fails because upon disconnection and reconnection OnIceComplete is | 4363 // currently fails because upon disconnection and reconnection OnIceComplete is |
4362 // called more than once without returning to IceGatheringGathering. | 4364 // called more than once without returning to IceGatheringGathering. |
4363 | 4365 |
4364 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4366 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
4365 WebRtcSessionTest, | 4367 WebRtcSessionTest, |
4366 testing::Values(ALREADY_GENERATED, | 4368 testing::Values(ALREADY_GENERATED, |
4367 DTLS_IDENTITY_STORE)); | 4369 DTLS_IDENTITY_STORE)); |
OLD | NEW |