OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 28 matching lines...) Expand all Loading... |
39 using rtc::ByteBufferReader; | 39 using rtc::ByteBufferReader; |
40 using rtc::ByteBufferWriter; | 40 using rtc::ByteBufferWriter; |
41 using rtc::NATType; | 41 using rtc::NATType; |
42 using rtc::NAT_OPEN_CONE; | 42 using rtc::NAT_OPEN_CONE; |
43 using rtc::NAT_ADDR_RESTRICTED; | 43 using rtc::NAT_ADDR_RESTRICTED; |
44 using rtc::NAT_PORT_RESTRICTED; | 44 using rtc::NAT_PORT_RESTRICTED; |
45 using rtc::NAT_SYMMETRIC; | 45 using rtc::NAT_SYMMETRIC; |
46 using rtc::PacketSocketFactory; | 46 using rtc::PacketSocketFactory; |
47 using rtc::Socket; | 47 using rtc::Socket; |
48 using rtc::SocketAddress; | 48 using rtc::SocketAddress; |
| 49 using rtc::kMaxNetworkCost; |
49 using namespace cricket; | 50 using namespace cricket; |
50 | 51 |
51 static const int kTimeout = 1000; | 52 static const int kTimeout = 1000; |
52 static const SocketAddress kLocalAddr1("192.168.1.2", 0); | 53 static const SocketAddress kLocalAddr1("192.168.1.2", 0); |
53 static const SocketAddress kLocalAddr2("192.168.1.3", 0); | 54 static const SocketAddress kLocalAddr2("192.168.1.3", 0); |
54 static const SocketAddress kNatAddr1("77.77.77.77", rtc::NAT_SERVER_UDP_PORT); | 55 static const SocketAddress kNatAddr1("77.77.77.77", rtc::NAT_SERVER_UDP_PORT); |
55 static const SocketAddress kNatAddr2("88.88.88.88", rtc::NAT_SERVER_UDP_PORT); | 56 static const SocketAddress kNatAddr2("88.88.88.88", rtc::NAT_SERVER_UDP_PORT); |
56 static const SocketAddress kStunAddr("99.99.99.1", STUN_SERVER_PORT); | 57 static const SocketAddress kStunAddr("99.99.99.1", STUN_SERVER_PORT); |
57 static const SocketAddress kRelayUdpIntAddr("99.99.99.2", 5000); | 58 static const SocketAddress kRelayUdpIntAddr("99.99.99.2", 5000); |
58 static const SocketAddress kRelayUdpExtAddr("99.99.99.3", 5001); | 59 static const SocketAddress kRelayUdpExtAddr("99.99.99.3", 5001); |
59 static const SocketAddress kRelayTcpIntAddr("99.99.99.2", 5002); | 60 static const SocketAddress kRelayTcpIntAddr("99.99.99.2", 5002); |
60 static const SocketAddress kRelayTcpExtAddr("99.99.99.3", 5003); | 61 static const SocketAddress kRelayTcpExtAddr("99.99.99.3", 5003); |
61 static const SocketAddress kRelaySslTcpIntAddr("99.99.99.2", 5004); | 62 static const SocketAddress kRelaySslTcpIntAddr("99.99.99.2", 5004); |
62 static const SocketAddress kRelaySslTcpExtAddr("99.99.99.3", 5005); | 63 static const SocketAddress kRelaySslTcpExtAddr("99.99.99.3", 5005); |
63 static const SocketAddress kTurnUdpIntAddr("99.99.99.4", STUN_SERVER_PORT); | 64 static const SocketAddress kTurnUdpIntAddr("99.99.99.4", STUN_SERVER_PORT); |
64 static const SocketAddress kTurnTcpIntAddr("99.99.99.4", 5010); | 65 static const SocketAddress kTurnTcpIntAddr("99.99.99.4", 5010); |
65 static const SocketAddress kTurnUdpExtAddr("99.99.99.5", 0); | 66 static const SocketAddress kTurnUdpExtAddr("99.99.99.5", 0); |
66 static const RelayCredentials kRelayCredentials("test", "test"); | 67 static const RelayCredentials kRelayCredentials("test", "test"); |
| 68 static const uint16_t kCostForUnknownNetworkType = 10; |
67 | 69 |
68 // TODO: Update these when RFC5245 is completely supported. | 70 // TODO: Update these when RFC5245 is completely supported. |
69 // Magic value of 30 is from RFC3484, for IPv4 addresses. | 71 // Magic value of 30 is from RFC3484, for IPv4 addresses. |
70 static const uint32_t kDefaultPrflxPriority = | 72 static const uint32_t kDefaultPrflxPriority = |
71 ICE_TYPE_PREFERENCE_PRFLX << 24 | 30 << 8 | | 73 ICE_TYPE_PREFERENCE_PRFLX << 24 | 30 << 8 | |
72 (256 - ICE_CANDIDATE_COMPONENT_DEFAULT); | 74 (256 - ICE_CANDIDATE_COMPONENT_DEFAULT); |
73 | 75 |
74 static const int kTiebreaker1 = 11111; | 76 static const int kTiebreaker1 = 11111; |
75 static const int kTiebreaker2 = 22222; | 77 static const int kTiebreaker2 = 22222; |
76 | 78 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 kRelayTcpExtAddr, | 379 kRelayTcpExtAddr, |
378 kRelaySslTcpIntAddr, | 380 kRelaySslTcpIntAddr, |
379 kRelaySslTcpExtAddr), | 381 kRelaySslTcpExtAddr), |
380 username_(rtc::CreateRandomString(ICE_UFRAG_LENGTH)), | 382 username_(rtc::CreateRandomString(ICE_UFRAG_LENGTH)), |
381 password_(rtc::CreateRandomString(ICE_PWD_LENGTH)), | 383 password_(rtc::CreateRandomString(ICE_PWD_LENGTH)), |
382 role_conflict_(false), | 384 role_conflict_(false), |
383 destroyed_(false) { | 385 destroyed_(false) { |
384 network_.AddIP(rtc::IPAddress(INADDR_ANY)); | 386 network_.AddIP(rtc::IPAddress(INADDR_ANY)); |
385 } | 387 } |
386 | 388 |
| 389 void ConnectSignalNeworkCostChangdForPort(PortInterface* port) { |
| 390 port->SignalNetworkCostChanged.connect(this, |
| 391 &PortTest::OnPortNetworkCostChanged); |
| 392 } |
| 393 |
| 394 void OnPortNetworkCostChanged(PortInterface* port) { |
| 395 port_network_cost_changed_ = true; |
| 396 ; |
| 397 } |
| 398 |
| 399 bool port_network_cost_changed() { return port_network_cost_changed_; } |
| 400 |
387 protected: | 401 protected: |
388 void TestLocalToLocal() { | 402 void TestLocalToLocal() { |
389 Port* port1 = CreateUdpPort(kLocalAddr1); | 403 Port* port1 = CreateUdpPort(kLocalAddr1); |
390 port1->SetIceRole(cricket::ICEROLE_CONTROLLING); | 404 port1->SetIceRole(cricket::ICEROLE_CONTROLLING); |
391 Port* port2 = CreateUdpPort(kLocalAddr2); | 405 Port* port2 = CreateUdpPort(kLocalAddr2); |
392 port2->SetIceRole(cricket::ICEROLE_CONTROLLED); | 406 port2->SetIceRole(cricket::ICEROLE_CONTROLLED); |
393 TestConnectivity("udp", port1, "udp", port2, true, true, true, true); | 407 TestConnectivity("udp", port1, "udp", port2, true, true, true, true); |
394 } | 408 } |
395 void TestLocalToStun(NATType ntype) { | 409 void TestLocalToStun(NATType ntype) { |
396 Port* port1 = CreateUdpPort(kLocalAddr1); | 410 Port* port1 = CreateUdpPort(kLocalAddr1); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 | 766 |
753 void OnDestroyed(PortInterface* port) { | 767 void OnDestroyed(PortInterface* port) { |
754 destroyed_ = true; | 768 destroyed_ = true; |
755 } | 769 } |
756 bool destroyed() const { return destroyed_; } | 770 bool destroyed() const { return destroyed_; } |
757 | 771 |
758 rtc::BasicPacketSocketFactory* nat_socket_factory1() { | 772 rtc::BasicPacketSocketFactory* nat_socket_factory1() { |
759 return &nat_socket_factory1_; | 773 return &nat_socket_factory1_; |
760 } | 774 } |
761 | 775 |
762 protected: | |
763 rtc::VirtualSocketServer* vss() { return ss_.get(); } | 776 rtc::VirtualSocketServer* vss() { return ss_.get(); } |
764 | 777 |
765 private: | 778 private: |
766 rtc::Thread* main_; | 779 rtc::Thread* main_; |
767 std::unique_ptr<rtc::PhysicalSocketServer> pss_; | 780 std::unique_ptr<rtc::PhysicalSocketServer> pss_; |
768 std::unique_ptr<rtc::VirtualSocketServer> ss_; | 781 std::unique_ptr<rtc::VirtualSocketServer> ss_; |
769 rtc::SocketServerScope ss_scope_; | 782 rtc::SocketServerScope ss_scope_; |
770 rtc::Network network_; | 783 rtc::Network network_; |
771 rtc::BasicPacketSocketFactory socket_factory_; | 784 rtc::BasicPacketSocketFactory socket_factory_; |
772 std::unique_ptr<rtc::NATServer> nat_server1_; | 785 std::unique_ptr<rtc::NATServer> nat_server1_; |
773 std::unique_ptr<rtc::NATServer> nat_server2_; | 786 std::unique_ptr<rtc::NATServer> nat_server2_; |
774 rtc::NATSocketFactory nat_factory1_; | 787 rtc::NATSocketFactory nat_factory1_; |
775 rtc::NATSocketFactory nat_factory2_; | 788 rtc::NATSocketFactory nat_factory2_; |
776 rtc::BasicPacketSocketFactory nat_socket_factory1_; | 789 rtc::BasicPacketSocketFactory nat_socket_factory1_; |
777 rtc::BasicPacketSocketFactory nat_socket_factory2_; | 790 rtc::BasicPacketSocketFactory nat_socket_factory2_; |
778 std::unique_ptr<TestStunServer> stun_server_; | 791 std::unique_ptr<TestStunServer> stun_server_; |
779 TestTurnServer turn_server_; | 792 TestTurnServer turn_server_; |
780 TestRelayServer relay_server_; | 793 TestRelayServer relay_server_; |
781 std::string username_; | 794 std::string username_; |
782 std::string password_; | 795 std::string password_; |
783 bool role_conflict_; | 796 bool role_conflict_; |
784 bool destroyed_; | 797 bool destroyed_; |
| 798 bool port_network_cost_changed_ = false; |
785 }; | 799 }; |
786 | 800 |
787 void PortTest::TestConnectivity(const char* name1, Port* port1, | 801 void PortTest::TestConnectivity(const char* name1, Port* port1, |
788 const char* name2, Port* port2, | 802 const char* name2, Port* port2, |
789 bool accept, bool same_addr1, | 803 bool accept, bool same_addr1, |
790 bool same_addr2, bool possible) { | 804 bool same_addr2, bool possible) { |
791 LOG(LS_INFO) << "Test: " << name1 << " to " << name2 << ": "; | 805 LOG(LS_INFO) << "Test: " << name1 << " to " << name2 << ": "; |
792 port1->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT); | 806 port1->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT); |
793 port2->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT); | 807 port2->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT); |
794 | 808 |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000); | 1769 ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000); |
1756 IceMessage* msg = lport->last_stun_msg(); | 1770 IceMessage* msg = lport->last_stun_msg(); |
1757 const StunUInt64Attribute* ice_controlling_attr = | 1771 const StunUInt64Attribute* ice_controlling_attr = |
1758 msg->GetUInt64(STUN_ATTR_ICE_CONTROLLING); | 1772 msg->GetUInt64(STUN_ATTR_ICE_CONTROLLING); |
1759 ASSERT_TRUE(ice_controlling_attr != NULL); | 1773 ASSERT_TRUE(ice_controlling_attr != NULL); |
1760 const StunByteStringAttribute* use_candidate_attr = msg->GetByteString( | 1774 const StunByteStringAttribute* use_candidate_attr = msg->GetByteString( |
1761 STUN_ATTR_USE_CANDIDATE); | 1775 STUN_ATTR_USE_CANDIDATE); |
1762 ASSERT_TRUE(use_candidate_attr != NULL); | 1776 ASSERT_TRUE(use_candidate_attr != NULL); |
1763 } | 1777 } |
1764 | 1778 |
| 1779 // Tests that when the network type changes, the network cost of the port will |
| 1780 // change, the network cost of the local candidates will change and a signal |
| 1781 // will be fire to notify the network cost change if there are connections in |
| 1782 // the port. Also tests that the remote network costs are updated with the stun |
| 1783 // binding requests. |
| 1784 TEST_F(PortTest, TestNetworkCostChange) { |
| 1785 std::unique_ptr<TestPort> lport( |
| 1786 CreateTestPort(kLocalAddr1, "lfrag", "lpass")); |
| 1787 std::unique_ptr<TestPort> rport( |
| 1788 CreateTestPort(kLocalAddr2, "rfrag", "rpass")); |
| 1789 lport->SetIceRole(cricket::ICEROLE_CONTROLLING); |
| 1790 lport->SetIceTiebreaker(kTiebreaker1); |
| 1791 rport->SetIceRole(cricket::ICEROLE_CONTROLLED); |
| 1792 rport->SetIceTiebreaker(kTiebreaker2); |
| 1793 lport->PrepareAddress(); |
| 1794 rport->PrepareAddress(); |
| 1795 ConnectSignalNeworkCostChangdForPort(lport.get()); |
| 1796 |
| 1797 // Default local port cost is kCostForUnknownNetworkType. |
| 1798 EXPECT_EQ(kCostForUnknownNetworkType, lport->network_cost()); |
| 1799 ASSERT_TRUE(!lport->Candidates().empty()); |
| 1800 for (const cricket::Candidate& candidate : lport->Candidates()) { |
| 1801 EXPECT_EQ(kCostForUnknownNetworkType, candidate.network_cost()); |
| 1802 } |
| 1803 |
| 1804 // Change the network type to wifi. |
| 1805 SetNetworkType(rtc::ADAPTER_TYPE_WIFI); |
| 1806 EXPECT_EQ(0, lport->network_cost()); |
| 1807 for (const cricket::Candidate& candidate : lport->Candidates()) { |
| 1808 EXPECT_EQ(0u, candidate.network_cost()); |
| 1809 } |
| 1810 // There is no connection yet, should not fire the NetworkCostChanged event. |
| 1811 EXPECT_FALSE(port_network_cost_changed()); |
| 1812 |
| 1813 // Add a connection and then change the network type. |
| 1814 Connection* lconn = |
| 1815 lport->CreateConnection(rport->Candidates()[0], Port::ORIGIN_MESSAGE); |
| 1816 // Change the network type to cellular. |
| 1817 SetNetworkType(rtc::ADAPTER_TYPE_CELLULAR); |
| 1818 EXPECT_EQ(kMaxNetworkCost, lport->network_cost()); |
| 1819 for (const cricket::Candidate& candidate : lport->Candidates()) { |
| 1820 EXPECT_EQ(kMaxNetworkCost, candidate.network_cost()); |
| 1821 } |
| 1822 // Should fire SignalNetworkCostChanged now. |
| 1823 EXPECT_TRUE(port_network_cost_changed()); |
| 1824 |
| 1825 SetNetworkType(rtc::ADAPTER_TYPE_WIFI); |
| 1826 Connection* rconn = |
| 1827 rport->CreateConnection(lport->Candidates()[0], Port::ORIGIN_MESSAGE); |
| 1828 SetNetworkType(rtc::ADAPTER_TYPE_CELLULAR); |
| 1829 lconn->Ping(0); |
| 1830 // The rconn's remote candidate cost is 0, but the ping contains an attribute |
| 1831 // of network cost of kMaxNetworkCost. Once the message is handled in rconn, |
| 1832 // The rconn's remote candidate will have cost kMaxNetworkCost; |
| 1833 EXPECT_EQ(0u, rconn->remote_candidate().network_cost()); |
| 1834 ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000); |
| 1835 IceMessage* msg = lport->last_stun_msg(); |
| 1836 EXPECT_EQ(STUN_BINDING_REQUEST, msg->type()); |
| 1837 // Pass the binding request to rport. |
| 1838 rconn->OnReadPacket(lport->last_stun_buf()->data<char>(), |
| 1839 lport->last_stun_buf()->size(), rtc::PacketTime()); |
| 1840 // Wait until rport sends the response and then check the remote network cost. |
| 1841 ASSERT_TRUE_WAIT(rport->last_stun_msg() != NULL, 1000); |
| 1842 EXPECT_EQ(kMaxNetworkCost, rconn->remote_candidate().network_cost()); |
| 1843 } |
| 1844 |
1765 TEST_F(PortTest, TestNetworkInfoAttribute) { | 1845 TEST_F(PortTest, TestNetworkInfoAttribute) { |
1766 std::unique_ptr<TestPort> lport( | 1846 std::unique_ptr<TestPort> lport( |
1767 CreateTestPort(kLocalAddr1, "lfrag", "lpass")); | 1847 CreateTestPort(kLocalAddr1, "lfrag", "lpass")); |
1768 // Set the network type for rport to be cellular so its cost will be 999. | |
1769 SetNetworkType(rtc::ADAPTER_TYPE_CELLULAR); | |
1770 std::unique_ptr<TestPort> rport( | 1848 std::unique_ptr<TestPort> rport( |
1771 CreateTestPort(kLocalAddr2, "rfrag", "rpass")); | 1849 CreateTestPort(kLocalAddr2, "rfrag", "rpass")); |
1772 lport->SetIceRole(cricket::ICEROLE_CONTROLLING); | 1850 lport->SetIceRole(cricket::ICEROLE_CONTROLLING); |
1773 lport->SetIceTiebreaker(kTiebreaker1); | 1851 lport->SetIceTiebreaker(kTiebreaker1); |
1774 rport->SetIceRole(cricket::ICEROLE_CONTROLLED); | 1852 rport->SetIceRole(cricket::ICEROLE_CONTROLLED); |
1775 rport->SetIceTiebreaker(kTiebreaker2); | 1853 rport->SetIceTiebreaker(kTiebreaker2); |
1776 | 1854 |
1777 uint16_t lnetwork_id = 9; | 1855 uint16_t lnetwork_id = 9; |
1778 lport->Network()->set_id(lnetwork_id); | 1856 lport->Network()->set_id(lnetwork_id); |
1779 // Send a fake ping from lport to rport. | 1857 // Send a fake ping from lport to rport. |
1780 lport->PrepareAddress(); | 1858 lport->PrepareAddress(); |
1781 rport->PrepareAddress(); | 1859 rport->PrepareAddress(); |
1782 Connection* lconn = | 1860 Connection* lconn = |
1783 lport->CreateConnection(rport->Candidates()[0], Port::ORIGIN_MESSAGE); | 1861 lport->CreateConnection(rport->Candidates()[0], Port::ORIGIN_MESSAGE); |
1784 lconn->Ping(0); | 1862 lconn->Ping(0); |
1785 ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000); | 1863 ASSERT_TRUE_WAIT(lport->last_stun_msg() != NULL, 1000); |
1786 IceMessage* msg = lport->last_stun_msg(); | 1864 IceMessage* msg = lport->last_stun_msg(); |
1787 const StunUInt32Attribute* network_info_attr = | 1865 const StunUInt32Attribute* network_info_attr = |
1788 msg->GetUInt32(STUN_ATTR_NETWORK_INFO); | 1866 msg->GetUInt32(STUN_ATTR_NETWORK_INFO); |
1789 ASSERT_TRUE(network_info_attr != NULL); | 1867 ASSERT_TRUE(network_info_attr != NULL); |
1790 uint32_t network_info = network_info_attr->value(); | 1868 uint32_t network_info = network_info_attr->value(); |
1791 EXPECT_EQ(lnetwork_id, network_info >> 16); | 1869 EXPECT_EQ(lnetwork_id, network_info >> 16); |
1792 // Default network cost is 0. | 1870 // Default network has unknown type and cost |kCostForUnknownNetworkType|. |
1793 EXPECT_EQ(0U, network_info & 0xFFFF); | 1871 EXPECT_EQ(kCostForUnknownNetworkType, network_info & 0xFFFF); |
1794 | 1872 |
| 1873 // Set the network type to be cellular so its cost will be 999. |
1795 // Send a fake ping from rport to lport. | 1874 // Send a fake ping from rport to lport. |
| 1875 SetNetworkType(rtc::ADAPTER_TYPE_CELLULAR); |
1796 uint16_t rnetwork_id = 8; | 1876 uint16_t rnetwork_id = 8; |
1797 rport->Network()->set_id(rnetwork_id); | 1877 rport->Network()->set_id(rnetwork_id); |
1798 Connection* rconn = | 1878 Connection* rconn = |
1799 rport->CreateConnection(lport->Candidates()[0], Port::ORIGIN_MESSAGE); | 1879 rport->CreateConnection(lport->Candidates()[0], Port::ORIGIN_MESSAGE); |
1800 rconn->Ping(0); | 1880 rconn->Ping(0); |
1801 ASSERT_TRUE_WAIT(rport->last_stun_msg() != NULL, 1000); | 1881 ASSERT_TRUE_WAIT(rport->last_stun_msg() != NULL, 1000); |
1802 msg = rport->last_stun_msg(); | 1882 msg = rport->last_stun_msg(); |
1803 network_info_attr = msg->GetUInt32(STUN_ATTR_NETWORK_INFO); | 1883 network_info_attr = msg->GetUInt32(STUN_ATTR_NETWORK_INFO); |
1804 ASSERT_TRUE(network_info_attr != NULL); | 1884 ASSERT_TRUE(network_info_attr != NULL); |
1805 network_info = network_info_attr->value(); | 1885 network_info = network_info_attr->value(); |
1806 EXPECT_EQ(rnetwork_id, network_info >> 16); | 1886 EXPECT_EQ(rnetwork_id, network_info >> 16); |
1807 EXPECT_EQ(cricket::kMaxNetworkCost, network_info & 0xFFFF); | 1887 EXPECT_EQ(kMaxNetworkCost, network_info & 0xFFFF); |
1808 } | 1888 } |
1809 | 1889 |
1810 // Test handling STUN messages. | 1890 // Test handling STUN messages. |
1811 TEST_F(PortTest, TestHandleStunMessage) { | 1891 TEST_F(PortTest, TestHandleStunMessage) { |
1812 // Our port will act as the "remote" port. | 1892 // Our port will act as the "remote" port. |
1813 std::unique_ptr<TestPort> port(CreateTestPort(kLocalAddr2, "rfrag", "rpass")); | 1893 std::unique_ptr<TestPort> port(CreateTestPort(kLocalAddr2, "rfrag", "rpass")); |
1814 | 1894 |
1815 std::unique_ptr<IceMessage> in_msg, out_msg; | 1895 std::unique_ptr<IceMessage> in_msg, out_msg; |
1816 std::unique_ptr<ByteBufferWriter> buf(new ByteBufferWriter()); | 1896 std::unique_ptr<ByteBufferWriter> buf(new ByteBufferWriter()); |
1817 rtc::SocketAddress addr(kLocalAddr1); | 1897 rtc::SocketAddress addr(kLocalAddr1); |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2579 std::unique_ptr<Port> tcp_port(CreateTcpPort(kLocalAddr1)); | 2659 std::unique_ptr<Port> tcp_port(CreateTcpPort(kLocalAddr1)); |
2580 EXPECT_TRUE(tcp_port->SupportsProtocol(TCP_PROTOCOL_NAME)); | 2660 EXPECT_TRUE(tcp_port->SupportsProtocol(TCP_PROTOCOL_NAME)); |
2581 EXPECT_TRUE(tcp_port->SupportsProtocol(SSLTCP_PROTOCOL_NAME)); | 2661 EXPECT_TRUE(tcp_port->SupportsProtocol(SSLTCP_PROTOCOL_NAME)); |
2582 EXPECT_FALSE(tcp_port->SupportsProtocol(UDP_PROTOCOL_NAME)); | 2662 EXPECT_FALSE(tcp_port->SupportsProtocol(UDP_PROTOCOL_NAME)); |
2583 | 2663 |
2584 std::unique_ptr<Port> turn_port( | 2664 std::unique_ptr<Port> turn_port( |
2585 CreateTurnPort(kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP)); | 2665 CreateTurnPort(kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP)); |
2586 EXPECT_TRUE(turn_port->SupportsProtocol(UDP_PROTOCOL_NAME)); | 2666 EXPECT_TRUE(turn_port->SupportsProtocol(UDP_PROTOCOL_NAME)); |
2587 EXPECT_FALSE(turn_port->SupportsProtocol(TCP_PROTOCOL_NAME)); | 2667 EXPECT_FALSE(turn_port->SupportsProtocol(TCP_PROTOCOL_NAME)); |
2588 } | 2668 } |
OLD | NEW |