| 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 config.ice_candidate_pool_size = 1; | 1051 config.ice_candidate_pool_size = 1; |
| 1052 CreatePeerConnection(config, nullptr); | 1052 CreatePeerConnection(config, nullptr); |
| 1053 | 1053 |
| 1054 const cricket::FakePortAllocatorSession* session = | 1054 const cricket::FakePortAllocatorSession* session = |
| 1055 static_cast<const cricket::FakePortAllocatorSession*>( | 1055 static_cast<const cricket::FakePortAllocatorSession*>( |
| 1056 port_allocator_->GetPooledSession()); | 1056 port_allocator_->GetPooledSession()); |
| 1057 ASSERT_NE(nullptr, session); | 1057 ASSERT_NE(nullptr, session); |
| 1058 EXPECT_EQ(1UL, session->stun_servers().size()); | 1058 EXPECT_EQ(1UL, session->stun_servers().size()); |
| 1059 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6); | 1059 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6); |
| 1060 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP); | 1060 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP); |
| 1061 EXPECT_EQ(cricket::CF_RELAY, session->candidate_filter()); | |
| 1062 } | 1061 } |
| 1063 | 1062 |
| 1064 TEST_F(PeerConnectionInterfaceTest, AddStreams) { | 1063 TEST_F(PeerConnectionInterfaceTest, AddStreams) { |
| 1065 CreatePeerConnection(); | 1064 CreatePeerConnection(); |
| 1066 AddVideoStream(kStreamLabel1); | 1065 AddVideoStream(kStreamLabel1); |
| 1067 AddVoiceStream(kStreamLabel2); | 1066 AddVoiceStream(kStreamLabel2); |
| 1068 ASSERT_EQ(2u, pc_->local_streams()->count()); | 1067 ASSERT_EQ(2u, pc_->local_streams()->count()); |
| 1069 | 1068 |
| 1070 // Test we can add multiple local streams to one peerconnection. | 1069 // Test we can add multiple local streams to one peerconnection. |
| 1071 scoped_refptr<MediaStreamInterface> stream( | 1070 scoped_refptr<MediaStreamInterface> stream( |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1966 // attributes, the pooled session is created with the updated attributes. | 1965 // attributes, the pooled session is created with the updated attributes. |
| 1967 TEST_F(PeerConnectionInterfaceTest, | 1966 TEST_F(PeerConnectionInterfaceTest, |
| 1968 SetConfigurationCreatesPooledSessionCorrectly) { | 1967 SetConfigurationCreatesPooledSessionCorrectly) { |
| 1969 CreatePeerConnection(); | 1968 CreatePeerConnection(); |
| 1970 PeerConnectionInterface::RTCConfiguration config; | 1969 PeerConnectionInterface::RTCConfiguration config; |
| 1971 config.ice_candidate_pool_size = 1; | 1970 config.ice_candidate_pool_size = 1; |
| 1972 PeerConnectionInterface::IceServer server; | 1971 PeerConnectionInterface::IceServer server; |
| 1973 server.uri = kStunAddressOnly; | 1972 server.uri = kStunAddressOnly; |
| 1974 config.servers.push_back(server); | 1973 config.servers.push_back(server); |
| 1975 config.type = PeerConnectionInterface::kRelay; | 1974 config.type = PeerConnectionInterface::kRelay; |
| 1976 CreatePeerConnection(config, nullptr); | 1975 EXPECT_TRUE(pc_->SetConfiguration(config)); |
| 1977 | 1976 |
| 1978 const cricket::FakePortAllocatorSession* session = | 1977 const cricket::FakePortAllocatorSession* session = |
| 1979 static_cast<const cricket::FakePortAllocatorSession*>( | 1978 static_cast<const cricket::FakePortAllocatorSession*>( |
| 1980 port_allocator_->GetPooledSession()); | 1979 port_allocator_->GetPooledSession()); |
| 1981 ASSERT_NE(nullptr, session); | 1980 ASSERT_NE(nullptr, session); |
| 1982 EXPECT_EQ(1UL, session->stun_servers().size()); | 1981 EXPECT_EQ(1UL, session->stun_servers().size()); |
| 1983 EXPECT_EQ(cricket::CF_RELAY, session->candidate_filter()); | |
| 1984 } | 1982 } |
| 1985 | 1983 |
| 1986 // Test that PeerConnection::Close changes the states to closed and all remote | 1984 // Test that PeerConnection::Close changes the states to closed and all remote |
| 1987 // tracks change state to ended. | 1985 // tracks change state to ended. |
| 1988 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { | 1986 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { |
| 1989 // Initialize a PeerConnection and negotiate local and remote session | 1987 // Initialize a PeerConnection and negotiate local and remote session |
| 1990 // description. | 1988 // description. |
| 1991 InitiateCall(); | 1989 InitiateCall(); |
| 1992 ASSERT_EQ(1u, pc_->local_streams()->count()); | 1990 ASSERT_EQ(1u, pc_->local_streams()->count()); |
| 1993 ASSERT_EQ(1u, pc_->remote_streams()->count()); | 1991 ASSERT_EQ(1u, pc_->remote_streams()->count()); |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2806 FakeConstraints updated_answer_c; | 2804 FakeConstraints updated_answer_c; |
| 2807 answer_c.SetMandatoryReceiveAudio(false); | 2805 answer_c.SetMandatoryReceiveAudio(false); |
| 2808 answer_c.SetMandatoryReceiveVideo(false); | 2806 answer_c.SetMandatoryReceiveVideo(false); |
| 2809 | 2807 |
| 2810 cricket::MediaSessionOptions updated_answer_options; | 2808 cricket::MediaSessionOptions updated_answer_options; |
| 2811 EXPECT_TRUE( | 2809 EXPECT_TRUE( |
| 2812 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2810 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
| 2813 EXPECT_TRUE(updated_answer_options.has_audio()); | 2811 EXPECT_TRUE(updated_answer_options.has_audio()); |
| 2814 EXPECT_TRUE(updated_answer_options.has_video()); | 2812 EXPECT_TRUE(updated_answer_options.has_video()); |
| 2815 } | 2813 } |
| OLD | NEW |