OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 // Test that a connection succeeds when the P2PTransportChannel uses a pooled | 1565 // Test that a connection succeeds when the P2PTransportChannel uses a pooled |
1566 // PortAllocatorSession that has not yet finished gathering candidates. | 1566 // PortAllocatorSession that has not yet finished gathering candidates. |
1567 TEST_F(P2PTransportChannelTest, TestUsingPooledSessionBeforeDoneGathering) { | 1567 TEST_F(P2PTransportChannelTest, TestUsingPooledSessionBeforeDoneGathering) { |
1568 ConfigureEndpoints(OPEN, OPEN, kDefaultPortAllocatorFlags, | 1568 ConfigureEndpoints(OPEN, OPEN, kDefaultPortAllocatorFlags, |
1569 kDefaultPortAllocatorFlags); | 1569 kDefaultPortAllocatorFlags); |
1570 // First create a pooled session for each endpoint. | 1570 // First create a pooled session for each endpoint. |
1571 auto& allocator_1 = GetEndpoint(0)->allocator_; | 1571 auto& allocator_1 = GetEndpoint(0)->allocator_; |
1572 auto& allocator_2 = GetEndpoint(1)->allocator_; | 1572 auto& allocator_2 = GetEndpoint(1)->allocator_; |
1573 int pool_size = 1; | 1573 int pool_size = 1; |
1574 allocator_1->SetConfiguration(allocator_1->stun_servers(), | 1574 allocator_1->SetConfiguration(allocator_1->stun_servers(), |
1575 allocator_1->turn_servers(), pool_size); | 1575 allocator_1->turn_servers(), pool_size, false); |
1576 allocator_2->SetConfiguration(allocator_2->stun_servers(), | 1576 allocator_2->SetConfiguration(allocator_2->stun_servers(), |
1577 allocator_2->turn_servers(), pool_size); | 1577 allocator_2->turn_servers(), pool_size, false); |
1578 const PortAllocatorSession* pooled_session_1 = | 1578 const PortAllocatorSession* pooled_session_1 = |
1579 allocator_1->GetPooledSession(); | 1579 allocator_1->GetPooledSession(); |
1580 const PortAllocatorSession* pooled_session_2 = | 1580 const PortAllocatorSession* pooled_session_2 = |
1581 allocator_2->GetPooledSession(); | 1581 allocator_2->GetPooledSession(); |
1582 ASSERT_NE(nullptr, pooled_session_1); | 1582 ASSERT_NE(nullptr, pooled_session_1); |
1583 ASSERT_NE(nullptr, pooled_session_2); | 1583 ASSERT_NE(nullptr, pooled_session_2); |
1584 // Sanity check that pooled sessions haven't gathered anything yet. | 1584 // Sanity check that pooled sessions haven't gathered anything yet. |
1585 EXPECT_TRUE(pooled_session_1->ReadyPorts().empty()); | 1585 EXPECT_TRUE(pooled_session_1->ReadyPorts().empty()); |
1586 EXPECT_TRUE(pooled_session_1->ReadyCandidates().empty()); | 1586 EXPECT_TRUE(pooled_session_1->ReadyCandidates().empty()); |
1587 EXPECT_TRUE(pooled_session_2->ReadyPorts().empty()); | 1587 EXPECT_TRUE(pooled_session_2->ReadyPorts().empty()); |
(...skipping 20 matching lines...) Expand all Loading... |
1608 // Test that a connection succeeds when the P2PTransportChannel uses a pooled | 1608 // Test that a connection succeeds when the P2PTransportChannel uses a pooled |
1609 // PortAllocatorSession that already finished gathering candidates. | 1609 // PortAllocatorSession that already finished gathering candidates. |
1610 TEST_F(P2PTransportChannelTest, TestUsingPooledSessionAfterDoneGathering) { | 1610 TEST_F(P2PTransportChannelTest, TestUsingPooledSessionAfterDoneGathering) { |
1611 ConfigureEndpoints(OPEN, OPEN, kDefaultPortAllocatorFlags, | 1611 ConfigureEndpoints(OPEN, OPEN, kDefaultPortAllocatorFlags, |
1612 kDefaultPortAllocatorFlags); | 1612 kDefaultPortAllocatorFlags); |
1613 // First create a pooled session for each endpoint. | 1613 // First create a pooled session for each endpoint. |
1614 auto& allocator_1 = GetEndpoint(0)->allocator_; | 1614 auto& allocator_1 = GetEndpoint(0)->allocator_; |
1615 auto& allocator_2 = GetEndpoint(1)->allocator_; | 1615 auto& allocator_2 = GetEndpoint(1)->allocator_; |
1616 int pool_size = 1; | 1616 int pool_size = 1; |
1617 allocator_1->SetConfiguration(allocator_1->stun_servers(), | 1617 allocator_1->SetConfiguration(allocator_1->stun_servers(), |
1618 allocator_1->turn_servers(), pool_size); | 1618 allocator_1->turn_servers(), pool_size, false); |
1619 allocator_2->SetConfiguration(allocator_2->stun_servers(), | 1619 allocator_2->SetConfiguration(allocator_2->stun_servers(), |
1620 allocator_2->turn_servers(), pool_size); | 1620 allocator_2->turn_servers(), pool_size, false); |
1621 const PortAllocatorSession* pooled_session_1 = | 1621 const PortAllocatorSession* pooled_session_1 = |
1622 allocator_1->GetPooledSession(); | 1622 allocator_1->GetPooledSession(); |
1623 const PortAllocatorSession* pooled_session_2 = | 1623 const PortAllocatorSession* pooled_session_2 = |
1624 allocator_2->GetPooledSession(); | 1624 allocator_2->GetPooledSession(); |
1625 ASSERT_NE(nullptr, pooled_session_1); | 1625 ASSERT_NE(nullptr, pooled_session_1); |
1626 ASSERT_NE(nullptr, pooled_session_2); | 1626 ASSERT_NE(nullptr, pooled_session_2); |
1627 // Wait for the pooled sessions to finish gathering before the | 1627 // Wait for the pooled sessions to finish gathering before the |
1628 // P2PTransportChannels try to use them. | 1628 // P2PTransportChannels try to use them. |
1629 EXPECT_TRUE_WAIT(pooled_session_1->CandidatesAllocationDone() && | 1629 EXPECT_TRUE_WAIT(pooled_session_1->CandidatesAllocationDone() && |
1630 pooled_session_2->CandidatesAllocationDone(), | 1630 pooled_session_2->CandidatesAllocationDone(), |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3482 | 3482 |
3483 // TCP Relay/Relay is the next. | 3483 // TCP Relay/Relay is the next. |
3484 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE, | 3484 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE, |
3485 TCP_PROTOCOL_NAME); | 3485 TCP_PROTOCOL_NAME); |
3486 | 3486 |
3487 // Finally, Local/Relay will be pinged. | 3487 // Finally, Local/Relay will be pinged. |
3488 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE); | 3488 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE); |
3489 } | 3489 } |
3490 | 3490 |
3491 } // namespace cricket { | 3491 } // namespace cricket { |
OLD | NEW |