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