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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 EXPECT_TRUE(GetEndpoint(0)->ready_to_send_); | 2172 EXPECT_TRUE(GetEndpoint(0)->ready_to_send_); |
2173 EXPECT_EQ(len, SendData(ep1_ch1(), data, len)); | 2173 EXPECT_EQ(len, SendData(ep1_ch1(), data, len)); |
2174 } | 2174 } |
2175 | 2175 |
2176 // Test what happens when we have 2 users behind the same NAT. This can lead | 2176 // Test what happens when we have 2 users behind the same NAT. This can lead |
2177 // to interesting behavior because the STUN server will only give out the | 2177 // to interesting behavior because the STUN server will only give out the |
2178 // address of the outermost NAT. | 2178 // address of the outermost NAT. |
2179 class P2PTransportChannelSameNatTest : public P2PTransportChannelTestBase { | 2179 class P2PTransportChannelSameNatTest : public P2PTransportChannelTestBase { |
2180 protected: | 2180 protected: |
2181 void ConfigureEndpoints(Config nat_type, Config config1, Config config2) { | 2181 void ConfigureEndpoints(Config nat_type, Config config1, Config config2) { |
2182 RTC_CHECK(nat_type >= NAT_FULL_CONE && nat_type <= NAT_SYMMETRIC); | 2182 RTC_CHECK_GE(nat_type, NAT_FULL_CONE); |
| 2183 RTC_CHECK_LE(nat_type, NAT_SYMMETRIC); |
2183 rtc::NATSocketServer::Translator* outer_nat = | 2184 rtc::NATSocketServer::Translator* outer_nat = |
2184 nat()->AddTranslator(kPublicAddrs[0], kNatAddrs[0], | 2185 nat()->AddTranslator(kPublicAddrs[0], kNatAddrs[0], |
2185 static_cast<rtc::NATType>(nat_type - NAT_FULL_CONE)); | 2186 static_cast<rtc::NATType>(nat_type - NAT_FULL_CONE)); |
2186 ConfigureEndpoint(outer_nat, 0, config1); | 2187 ConfigureEndpoint(outer_nat, 0, config1); |
2187 ConfigureEndpoint(outer_nat, 1, config2); | 2188 ConfigureEndpoint(outer_nat, 1, config2); |
2188 set_remote_ice_parameter_source(FROM_SETICEPARAMETERS); | 2189 set_remote_ice_parameter_source(FROM_SETICEPARAMETERS); |
2189 } | 2190 } |
2190 void ConfigureEndpoint(rtc::NATSocketServer::Translator* nat, | 2191 void ConfigureEndpoint(rtc::NATSocketServer::Translator* nat, |
2191 int endpoint, Config config) { | 2192 int endpoint, Config config) { |
2192 RTC_CHECK(config <= NAT_SYMMETRIC); | 2193 RTC_CHECK(config <= NAT_SYMMETRIC); |
(...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4507 | 4508 |
4508 // TCP Relay/Relay is the next. | 4509 // TCP Relay/Relay is the next. |
4509 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE, | 4510 VerifyNextPingableConnection(RELAY_PORT_TYPE, RELAY_PORT_TYPE, |
4510 TCP_PROTOCOL_NAME); | 4511 TCP_PROTOCOL_NAME); |
4511 | 4512 |
4512 // Finally, Local/Relay will be pinged. | 4513 // Finally, Local/Relay will be pinged. |
4513 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE); | 4514 VerifyNextPingableConnection(LOCAL_PORT_TYPE, RELAY_PORT_TYPE); |
4514 } | 4515 } |
4515 | 4516 |
4516 } // namespace cricket { | 4517 } // namespace cricket { |
OLD | NEW |