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 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2579 std::unique_ptr<Port> tcp_port(CreateTcpPort(kLocalAddr1)); | 2579 std::unique_ptr<Port> tcp_port(CreateTcpPort(kLocalAddr1)); |
2580 EXPECT_TRUE(tcp_port->SupportsProtocol(TCP_PROTOCOL_NAME)); | 2580 EXPECT_TRUE(tcp_port->SupportsProtocol(TCP_PROTOCOL_NAME)); |
2581 EXPECT_TRUE(tcp_port->SupportsProtocol(SSLTCP_PROTOCOL_NAME)); | 2581 EXPECT_TRUE(tcp_port->SupportsProtocol(SSLTCP_PROTOCOL_NAME)); |
2582 EXPECT_FALSE(tcp_port->SupportsProtocol(UDP_PROTOCOL_NAME)); | 2582 EXPECT_FALSE(tcp_port->SupportsProtocol(UDP_PROTOCOL_NAME)); |
2583 | 2583 |
2584 std::unique_ptr<Port> turn_port( | 2584 std::unique_ptr<Port> turn_port( |
2585 CreateTurnPort(kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP)); | 2585 CreateTurnPort(kLocalAddr1, nat_socket_factory1(), PROTO_UDP, PROTO_UDP)); |
2586 EXPECT_TRUE(turn_port->SupportsProtocol(UDP_PROTOCOL_NAME)); | 2586 EXPECT_TRUE(turn_port->SupportsProtocol(UDP_PROTOCOL_NAME)); |
2587 EXPECT_FALSE(turn_port->SupportsProtocol(TCP_PROTOCOL_NAME)); | 2587 EXPECT_FALSE(turn_port->SupportsProtocol(TCP_PROTOCOL_NAME)); |
2588 } | 2588 } |
2589 | |
2590 // Test that SetIceParameters updates the component, ufrag and password | |
2591 // on both the port itself and its candidates. | |
2592 TEST_F(PortTest, TestSetIceParameters) { | |
2593 std::unique_ptr<TestPort> port( | |
2594 CreateTestPort(kLocalAddr1, "ufrag1", "password1")); | |
2595 port->PrepareAddress(); | |
2596 EXPECT_EQ(1UL, port->Candidates().size()); | |
2597 port->SetIceParameters(1, "ufrag2", "password2"); | |
2598 EXPECT_EQ(1, port->component()); | |
2599 EXPECT_EQ("ufrag2", port->username_fragment()); | |
2600 EXPECT_EQ("password2", port->password()); | |
2601 const Candidate& candidate = port->Candidates()[0]; | |
2602 EXPECT_EQ(1, candidate.component()); | |
2603 EXPECT_EQ("ufrag2", candidate.username()); | |
2604 EXPECT_EQ("password2", candidate.password()); | |
2605 } | |
OLD | NEW |