OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #define MAYBE_SKIP_TEST(feature) \ | 63 #define MAYBE_SKIP_TEST(feature) \ |
64 if (!(feature())) { \ | 64 if (!(feature())) { \ |
65 LOG(LS_INFO) << "Feature disabled... skipping"; \ | 65 LOG(LS_INFO) << "Feature disabled... skipping"; \ |
66 return; \ | 66 return; \ |
67 } | 67 } |
68 | 68 |
69 using cricket::BaseSession; | 69 using cricket::BaseSession; |
70 using cricket::DF_PLAY; | 70 using cricket::DF_PLAY; |
71 using cricket::DF_SEND; | 71 using cricket::DF_SEND; |
72 using cricket::FakeVoiceMediaChannel; | 72 using cricket::FakeVoiceMediaChannel; |
73 using cricket::NS_GINGLE_P2P; | |
74 using cricket::NS_JINGLE_ICE_UDP; | |
75 using cricket::TransportInfo; | 73 using cricket::TransportInfo; |
76 using rtc::SocketAddress; | 74 using rtc::SocketAddress; |
77 using rtc::scoped_ptr; | 75 using rtc::scoped_ptr; |
78 using rtc::Thread; | 76 using rtc::Thread; |
79 using webrtc::CreateSessionDescription; | 77 using webrtc::CreateSessionDescription; |
80 using webrtc::CreateSessionDescriptionObserver; | 78 using webrtc::CreateSessionDescriptionObserver; |
81 using webrtc::CreateSessionDescriptionRequest; | 79 using webrtc::CreateSessionDescriptionRequest; |
82 using webrtc::DTLSIdentityRequestObserver; | 80 using webrtc::DTLSIdentityRequestObserver; |
83 using webrtc::DTLSIdentityServiceInterface; | 81 using webrtc::DTLSIdentityServiceInterface; |
84 using webrtc::FakeConstraints; | 82 using webrtc::FakeConstraints; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 vss_(new rtc::VirtualSocketServer(pss_.get())), | 328 vss_(new rtc::VirtualSocketServer(pss_.get())), |
331 fss_(new rtc::FirewallSocketServer(vss_.get())), | 329 fss_(new rtc::FirewallSocketServer(vss_.get())), |
332 ss_scope_(fss_.get()), | 330 ss_scope_(fss_.get()), |
333 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, | 331 stun_socket_addr_(rtc::SocketAddress(kStunAddrHost, |
334 cricket::STUN_SERVER_PORT)), | 332 cricket::STUN_SERVER_PORT)), |
335 stun_server_(cricket::TestStunServer::Create(Thread::Current(), | 333 stun_server_(cricket::TestStunServer::Create(Thread::Current(), |
336 stun_socket_addr_)), | 334 stun_socket_addr_)), |
337 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), | 335 turn_server_(Thread::Current(), kTurnUdpIntAddr, kTurnUdpExtAddr), |
338 mediastream_signaling_(channel_manager_.get()), | 336 mediastream_signaling_(channel_manager_.get()), |
339 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { | 337 metrics_observer_(new rtc::RefCountedObject<FakeMetricsObserver>()) { |
340 tdesc_factory_->set_protocol(cricket::ICEPROTO_HYBRID); | |
341 | |
342 cricket::ServerAddresses stun_servers; | 338 cricket::ServerAddresses stun_servers; |
343 stun_servers.insert(stun_socket_addr_); | 339 stun_servers.insert(stun_socket_addr_); |
344 allocator_.reset(new cricket::BasicPortAllocator( | 340 allocator_.reset(new cricket::BasicPortAllocator( |
345 &network_manager_, | 341 &network_manager_, |
346 stun_servers, | 342 stun_servers, |
347 SocketAddress(), SocketAddress(), SocketAddress())); | 343 SocketAddress(), SocketAddress(), SocketAddress())); |
348 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | | 344 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
349 cricket::PORTALLOCATOR_DISABLE_RELAY | | 345 cricket::PORTALLOCATOR_DISABLE_RELAY); |
350 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); | |
351 EXPECT_TRUE(channel_manager_->Init()); | 346 EXPECT_TRUE(channel_manager_->Init()); |
352 desc_factory_->set_add_legacy_streams(false); | 347 desc_factory_->set_add_legacy_streams(false); |
353 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 348 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
354 } | 349 } |
355 | 350 |
356 void AddInterface(const SocketAddress& addr) { | 351 void AddInterface(const SocketAddress& addr) { |
357 network_manager_.AddInterface(addr); | 352 network_manager_.AddInterface(addr); |
358 } | 353 } |
359 | 354 |
360 void Init( | 355 void Init( |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, | 1128 EXPECT_EQ_WAIT(PeerConnectionInterface::kIceConnectionDisconnected, |
1134 observer_.ice_connection_state_, | 1129 observer_.ice_connection_state_, |
1135 kIceCandidatesTimeout + port_timeout); | 1130 kIceCandidatesTimeout + port_timeout); |
1136 } | 1131 } |
1137 | 1132 |
1138 void TestLoopbackCall() { | 1133 void TestLoopbackCall() { |
1139 LoopbackNetworkConfiguration config; | 1134 LoopbackNetworkConfiguration config; |
1140 TestLoopbackCall(config); | 1135 TestLoopbackCall(config); |
1141 } | 1136 } |
1142 | 1137 |
1143 void VerifyTransportType(const std::string& content_name, | |
1144 cricket::TransportProtocol protocol) { | |
1145 const cricket::Transport* transport = session_->GetTransport(content_name); | |
1146 ASSERT_TRUE(transport != NULL); | |
1147 EXPECT_EQ(protocol, transport->protocol()); | |
1148 } | |
1149 | |
1150 // Adds CN codecs to FakeMediaEngine and MediaDescriptionFactory. | 1138 // Adds CN codecs to FakeMediaEngine and MediaDescriptionFactory. |
1151 void AddCNCodecs() { | 1139 void AddCNCodecs() { |
1152 const cricket::AudioCodec kCNCodec1(102, "CN", 8000, 0, 1, 0); | 1140 const cricket::AudioCodec kCNCodec1(102, "CN", 8000, 0, 1, 0); |
1153 const cricket::AudioCodec kCNCodec2(103, "CN", 16000, 0, 1, 0); | 1141 const cricket::AudioCodec kCNCodec2(103, "CN", 16000, 0, 1, 0); |
1154 | 1142 |
1155 // Add kCNCodec for dtmf test. | 1143 // Add kCNCodec for dtmf test. |
1156 std::vector<cricket::AudioCodec> codecs = media_engine_->audio_codecs();; | 1144 std::vector<cricket::AudioCodec> codecs = media_engine_->audio_codecs();; |
1157 codecs.push_back(kCNCodec1); | 1145 codecs.push_back(kCNCodec1); |
1158 codecs.push_back(kCNCodec2); | 1146 codecs.push_back(kCNCodec2); |
1159 media_engine_->SetAudioCodecs(codecs); | 1147 media_engine_->SetAudioCodecs(codecs); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 } | 1209 } |
1222 | 1210 |
1223 void ConfigureAllocatorWithTurn() { | 1211 void ConfigureAllocatorWithTurn() { |
1224 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); | 1212 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); |
1225 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); | 1213 cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword); |
1226 relay_server.credentials = credentials; | 1214 relay_server.credentials = credentials; |
1227 relay_server.ports.push_back(cricket::ProtocolAddress( | 1215 relay_server.ports.push_back(cricket::ProtocolAddress( |
1228 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); | 1216 kTurnUdpIntAddr, cricket::PROTO_UDP, false)); |
1229 allocator_->AddRelay(relay_server); | 1217 allocator_->AddRelay(relay_server); |
1230 allocator_->set_step_delay(cricket::kMinimumStepDelay); | 1218 allocator_->set_step_delay(cricket::kMinimumStepDelay); |
1231 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | | 1219 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP); |
1232 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); | |
1233 } | 1220 } |
1234 | 1221 |
1235 cricket::FakeMediaEngine* media_engine_; | 1222 cricket::FakeMediaEngine* media_engine_; |
1236 cricket::FakeDataEngine* data_engine_; | 1223 cricket::FakeDataEngine* data_engine_; |
1237 cricket::FakeDeviceManager* device_manager_; | 1224 cricket::FakeDeviceManager* device_manager_; |
1238 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; | 1225 rtc::scoped_ptr<cricket::ChannelManager> channel_manager_; |
1239 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; | 1226 rtc::scoped_ptr<cricket::TransportDescriptionFactory> tdesc_factory_; |
1240 rtc::scoped_ptr<rtc::SSLIdentity> identity_; | 1227 rtc::scoped_ptr<rtc::SSLIdentity> identity_; |
1241 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; | 1228 rtc::scoped_ptr<cricket::MediaSessionDescriptionFactory> desc_factory_; |
1242 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; | 1229 rtc::scoped_ptr<rtc::PhysicalSocketServer> pss_; |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2528 RemoveIceUfragPwdLines(offer.get(), &sdp); | 2515 RemoveIceUfragPwdLines(offer.get(), &sdp); |
2529 SessionDescriptionInterface* modified_offer = | 2516 SessionDescriptionInterface* modified_offer = |
2530 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); | 2517 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); |
2531 SetRemoteDescriptionOfferExpectError(kSdpWithoutIceUfragPwd, modified_offer); | 2518 SetRemoteDescriptionOfferExpectError(kSdpWithoutIceUfragPwd, modified_offer); |
2532 } | 2519 } |
2533 | 2520 |
2534 // This test verifies that setLocalDescription fails if local offer has | 2521 // This test verifies that setLocalDescription fails if local offer has |
2535 // too short ice ufrag and pwd strings. | 2522 // too short ice ufrag and pwd strings. |
2536 TEST_F(WebRtcSessionTest, TestSetLocalDescriptionInvalidIceCredentials) { | 2523 TEST_F(WebRtcSessionTest, TestSetLocalDescriptionInvalidIceCredentials) { |
2537 Init(); | 2524 Init(); |
2538 tdesc_factory_->set_protocol(cricket::ICEPROTO_RFC5245); | |
2539 mediastream_signaling_.SendAudioVideoStream1(); | 2525 mediastream_signaling_.SendAudioVideoStream1(); |
2540 rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer()); | 2526 rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateOffer()); |
2541 | 2527 |
2542 std::string sdp; | 2528 std::string sdp; |
2543 // Modifying ice ufrag and pwd in local offer with strings smaller than the | 2529 // Modifying ice ufrag and pwd in local offer with strings smaller than the |
2544 // recommended values of 4 and 22 bytes respectively. | 2530 // recommended values of 4 and 22 bytes respectively. |
2545 ModifyIceUfragPwdLines(offer.get(), "ice", "icepwd", &sdp); | 2531 ModifyIceUfragPwdLines(offer.get(), "ice", "icepwd", &sdp); |
2546 SessionDescriptionInterface* modified_offer = | 2532 SessionDescriptionInterface* modified_offer = |
2547 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); | 2533 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); |
2548 std::string error; | 2534 std::string error; |
2549 EXPECT_FALSE(session_->SetLocalDescription(modified_offer, &error)); | 2535 EXPECT_FALSE(session_->SetLocalDescription(modified_offer, &error)); |
2550 | 2536 |
2551 // Test with string greater than 256. | 2537 // Test with string greater than 256. |
2552 sdp.clear(); | 2538 sdp.clear(); |
2553 ModifyIceUfragPwdLines(offer.get(), kTooLongIceUfragPwd, kTooLongIceUfragPwd, | 2539 ModifyIceUfragPwdLines(offer.get(), kTooLongIceUfragPwd, kTooLongIceUfragPwd, |
2554 &sdp); | 2540 &sdp); |
2555 modified_offer = CreateSessionDescription(JsepSessionDescription::kOffer, sdp, | 2541 modified_offer = CreateSessionDescription(JsepSessionDescription::kOffer, sdp, |
2556 NULL); | 2542 NULL); |
2557 EXPECT_FALSE(session_->SetLocalDescription(modified_offer, &error)); | 2543 EXPECT_FALSE(session_->SetLocalDescription(modified_offer, &error)); |
2558 } | 2544 } |
2559 | 2545 |
2560 // This test verifies that setRemoteDescription fails if remote offer has | 2546 // This test verifies that setRemoteDescription fails if remote offer has |
2561 // too short ice ufrag and pwd strings. | 2547 // too short ice ufrag and pwd strings. |
2562 TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionInvalidIceCredentials) { | 2548 TEST_F(WebRtcSessionTest, TestSetRemoteDescriptionInvalidIceCredentials) { |
2563 Init(); | 2549 Init(); |
2564 tdesc_factory_->set_protocol(cricket::ICEPROTO_RFC5245); | |
2565 rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer()); | 2550 rtc::scoped_ptr<SessionDescriptionInterface> offer(CreateRemoteOffer()); |
2566 std::string sdp; | 2551 std::string sdp; |
2567 // Modifying ice ufrag and pwd in remote offer with strings smaller than the | 2552 // Modifying ice ufrag and pwd in remote offer with strings smaller than the |
2568 // recommended values of 4 and 22 bytes respectively. | 2553 // recommended values of 4 and 22 bytes respectively. |
2569 ModifyIceUfragPwdLines(offer.get(), "ice", "icepwd", &sdp); | 2554 ModifyIceUfragPwdLines(offer.get(), "ice", "icepwd", &sdp); |
2570 SessionDescriptionInterface* modified_offer = | 2555 SessionDescriptionInterface* modified_offer = |
2571 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); | 2556 CreateSessionDescription(JsepSessionDescription::kOffer, sdp, NULL); |
2572 std::string error; | 2557 std::string error; |
2573 EXPECT_FALSE(session_->SetRemoteDescription(modified_offer, &error)); | 2558 EXPECT_FALSE(session_->SetRemoteDescription(modified_offer, &error)); |
2574 | 2559 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3128 EXPECT_FALSE(session_->initiator()); | 3113 EXPECT_FALSE(session_->initiator()); |
3129 SessionDescriptionInterface* offer = CreateRemoteOffer(); | 3114 SessionDescriptionInterface* offer = CreateRemoteOffer(); |
3130 SetRemoteDescriptionWithoutError(offer); | 3115 SetRemoteDescriptionWithoutError(offer); |
3131 SessionDescriptionInterface* answer = CreateAnswer(NULL); | 3116 SessionDescriptionInterface* answer = CreateAnswer(NULL); |
3132 | 3117 |
3133 EXPECT_FALSE(session_->initiator()); | 3118 EXPECT_FALSE(session_->initiator()); |
3134 SetLocalDescriptionWithoutError(answer); | 3119 SetLocalDescriptionWithoutError(answer); |
3135 EXPECT_FALSE(session_->initiator()); | 3120 EXPECT_FALSE(session_->initiator()); |
3136 } | 3121 } |
3137 | 3122 |
3138 // This test verifies the ice protocol type at initiator of the call | |
3139 // if |a=ice-options:google-ice| is present in answer. | |
3140 TEST_F(WebRtcSessionTest, TestInitiatorGIceInAnswer) { | |
3141 Init(); | |
3142 mediastream_signaling_.SendAudioVideoStream1(); | |
3143 SessionDescriptionInterface* offer = CreateOffer(); | |
3144 rtc::scoped_ptr<SessionDescriptionInterface> answer( | |
3145 CreateRemoteAnswer(offer)); | |
3146 SetLocalDescriptionWithoutError(offer); | |
3147 std::string sdp; | |
3148 EXPECT_TRUE(answer->ToString(&sdp)); | |
3149 // Adding ice-options to the session level. | |
3150 InjectAfter("t=0 0\r\n", | |
3151 "a=ice-options:google-ice\r\n", | |
3152 &sdp); | |
3153 SessionDescriptionInterface* answer_with_gice = | |
3154 CreateSessionDescription(JsepSessionDescription::kAnswer, sdp, NULL); | |
3155 // Default offer is ICEPROTO_RFC5245, so we expect responder with | |
3156 // only gice to fail. | |
3157 SetRemoteDescriptionAnswerExpectError(kPushDownTDFailed, answer_with_gice); | |
3158 } | |
3159 | |
3160 // This test verifies the ice protocol type at initiator of the call | |
3161 // if ICE RFC5245 is supported in answer. | |
3162 TEST_F(WebRtcSessionTest, TestInitiatorIceInAnswer) { | |
3163 Init(); | |
3164 mediastream_signaling_.SendAudioVideoStream1(); | |
3165 SessionDescriptionInterface* offer = CreateOffer(); | |
3166 SessionDescriptionInterface* answer = CreateRemoteAnswer(offer); | |
3167 SetLocalDescriptionWithoutError(offer); | |
3168 | |
3169 SetRemoteDescriptionWithoutError(answer); | |
3170 VerifyTransportType("audio", cricket::ICEPROTO_RFC5245); | |
3171 VerifyTransportType("video", cricket::ICEPROTO_RFC5245); | |
3172 } | |
3173 | |
3174 // This test verifies the ice protocol type at receiver side of the call if | |
3175 // receiver decides to use ice RFC 5245. | |
3176 TEST_F(WebRtcSessionTest, TestReceiverIceInOffer) { | |
3177 Init(); | |
3178 mediastream_signaling_.SendAudioVideoStream1(); | |
3179 SessionDescriptionInterface* offer = CreateOffer(); | |
3180 SetRemoteDescriptionWithoutError(offer); | |
3181 SessionDescriptionInterface* answer = CreateAnswer(NULL); | |
3182 SetLocalDescriptionWithoutError(answer); | |
3183 VerifyTransportType("audio", cricket::ICEPROTO_RFC5245); | |
3184 VerifyTransportType("video", cricket::ICEPROTO_RFC5245); | |
3185 } | |
3186 | |
3187 // Verifing local offer and remote answer have matching m-lines as per RFC 3264. | 3123 // Verifing local offer and remote answer have matching m-lines as per RFC 3264. |
3188 TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) { | 3124 TEST_F(WebRtcSessionTest, TestIncorrectMLinesInRemoteAnswer) { |
3189 Init(); | 3125 Init(); |
3190 mediastream_signaling_.SendAudioVideoStream1(); | 3126 mediastream_signaling_.SendAudioVideoStream1(); |
3191 SessionDescriptionInterface* offer = CreateOffer(); | 3127 SessionDescriptionInterface* offer = CreateOffer(); |
3192 SetLocalDescriptionWithoutError(offer); | 3128 SetLocalDescriptionWithoutError(offer); |
3193 rtc::scoped_ptr<SessionDescriptionInterface> answer( | 3129 rtc::scoped_ptr<SessionDescriptionInterface> answer( |
3194 CreateRemoteAnswer(session_->local_description())); | 3130 CreateRemoteAnswer(session_->local_description())); |
3195 | 3131 |
3196 cricket::SessionDescription* answer_copy = answer->description()->Copy(); | 3132 cricket::SessionDescription* answer_copy = answer->description()->Copy(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3397 | 3333 |
3398 mediastream_signaling_.SendAudioVideoStream2(); | 3334 mediastream_signaling_.SendAudioVideoStream2(); |
3399 SessionDescriptionInterface* answer = | 3335 SessionDescriptionInterface* answer = |
3400 CreateRemoteAnswer(session_->local_description()); | 3336 CreateRemoteAnswer(session_->local_description()); |
3401 SetRemoteDescriptionAnswerExpectError("ERROR_CONTENT", answer); | 3337 SetRemoteDescriptionAnswerExpectError("ERROR_CONTENT", answer); |
3402 } | 3338 } |
3403 | 3339 |
3404 // Runs the loopback call test with BUNDLE and STUN disabled. | 3340 // Runs the loopback call test with BUNDLE and STUN disabled. |
3405 TEST_F(WebRtcSessionTest, TestIceStatesBasic) { | 3341 TEST_F(WebRtcSessionTest, TestIceStatesBasic) { |
3406 // Lets try with only UDP ports. | 3342 // Lets try with only UDP ports. |
3407 allocator_->set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | | 3343 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
3408 cricket::PORTALLOCATOR_DISABLE_TCP | | |
3409 cricket::PORTALLOCATOR_DISABLE_STUN | | 3344 cricket::PORTALLOCATOR_DISABLE_STUN | |
3410 cricket::PORTALLOCATOR_DISABLE_RELAY); | 3345 cricket::PORTALLOCATOR_DISABLE_RELAY); |
3411 TestLoopbackCall(); | 3346 TestLoopbackCall(); |
3412 } | 3347 } |
3413 | 3348 |
3414 TEST_F(WebRtcSessionTest, TestIceStatesBasicIPv6) { | 3349 TEST_F(WebRtcSessionTest, TestIceStatesBasicIPv6) { |
3415 allocator_->set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | | 3350 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
3416 cricket::PORTALLOCATOR_DISABLE_TCP | | |
3417 cricket::PORTALLOCATOR_DISABLE_STUN | | 3351 cricket::PORTALLOCATOR_DISABLE_STUN | |
3418 cricket::PORTALLOCATOR_ENABLE_IPV6 | | 3352 cricket::PORTALLOCATOR_ENABLE_IPV6 | |
3419 cricket::PORTALLOCATOR_DISABLE_RELAY); | 3353 cricket::PORTALLOCATOR_DISABLE_RELAY); |
3420 | 3354 |
3421 // best connection is IPv6 since it has higher network preference. | 3355 // best connection is IPv6 since it has higher network preference. |
3422 LoopbackNetworkConfiguration config; | 3356 LoopbackNetworkConfiguration config; |
3423 config.test_ipv6_network_ = true; | 3357 config.test_ipv6_network_ = true; |
3424 config.best_connection_after_initial_ice_converged_ = | 3358 config.best_connection_after_initial_ice_converged_ = |
3425 LoopbackNetworkConfiguration::ExpectedBestConnection(0, 1); | 3359 LoopbackNetworkConfiguration::ExpectedBestConnection(0, 1); |
3426 | 3360 |
3427 TestLoopbackCall(config); | 3361 TestLoopbackCall(config); |
3428 } | 3362 } |
3429 | 3363 |
3430 // Runs the loopback call test with BUNDLE and STUN enabled. | 3364 // Runs the loopback call test with BUNDLE and STUN enabled. |
3431 TEST_F(WebRtcSessionTest, TestIceStatesBundle) { | 3365 TEST_F(WebRtcSessionTest, TestIceStatesBundle) { |
3432 allocator_->set_flags(cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | | 3366 allocator_->set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | |
3433 cricket::PORTALLOCATOR_DISABLE_TCP | | 3367 cricket::PORTALLOCATOR_DISABLE_RELAY); |
3434 cricket::PORTALLOCATOR_DISABLE_RELAY); | |
3435 TestLoopbackCall(); | 3368 TestLoopbackCall(); |
3436 } | 3369 } |
3437 | 3370 |
3438 TEST_F(WebRtcSessionTest, SetSdpFailedOnSessionError) { | 3371 TEST_F(WebRtcSessionTest, SetSdpFailedOnSessionError) { |
3439 Init(); | 3372 Init(); |
3440 cricket::MediaSessionOptions options; | 3373 cricket::MediaSessionOptions options; |
3441 options.recv_video = true; | 3374 options.recv_video = true; |
3442 | 3375 |
3443 cricket::BaseSession::Error error_code = cricket::BaseSession::ERROR_CONTENT; | 3376 cricket::BaseSession::Error error_code = cricket::BaseSession::ERROR_CONTENT; |
3444 std::string error_code_str = "ERROR_CONTENT"; | 3377 std::string error_code_str = "ERROR_CONTENT"; |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3941 // terminated. The offer creation may or may not have succeeded, but we | 3874 // terminated. The offer creation may or may not have succeeded, but we |
3942 // must have received a notification which, so the only invalid state | 3875 // must have received a notification which, so the only invalid state |
3943 // is kInit. | 3876 // is kInit. |
3944 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); | 3877 EXPECT_NE(WebRtcSessionCreateSDPObserverForTest::kInit, o->state()); |
3945 } | 3878 } |
3946 } | 3879 } |
3947 | 3880 |
3948 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 3881 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
3949 // currently fails because upon disconnection and reconnection OnIceComplete is | 3882 // currently fails because upon disconnection and reconnection OnIceComplete is |
3950 // called more than once without returning to IceGatheringGathering. | 3883 // called more than once without returning to IceGatheringGathering. |
OLD | NEW |